TL
API & MCPDokumentasyon

Platform ng Agent at API ng Road User Tools

I-convert ang kapangyarihan

Mag-convert sa pagitan ng kilowatts, mechanical horsepower, at metric horsepower (PS).

Mga interface

POST
REST endpoint/api/v1/power/convert
MCP
Pangalan ng toolconvert_power

Kahilingan

Ipadala ang kahilingan bilang JSON. Ang mga kliyente ng MCP ay pumasa sa parehong mga field bilang mga argumento ng tool.

cURLshell
curl -X POST https://roaduser.tools/api/v1/power/convert \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "content-type: application/json" \
  -d '{
  "value": 150,
  "from": "kw",
  "to": "hp"
}'
Humiling ng katawanjson
{
  "value": 150,
  "from": "kw",
  "to": "hp"
}

Tugon

Binabalot ng REST ang resulta ng pagkalkula sa karaniwang sobre ng tagumpay. Ibinabalik ng MCP ang parehong data ng pagkalkula bilang output ng structured tool.

JSON
{
  "ok": true,
  "data": {
    "input": {
      "value": 150,
      "from": "kw",
      "to": "hp"
    },
    "conversions": {
      "kw": 150,
      "hp": 201.1533134392542,
      "ps": 203.94324259558564
    },
    "result": 201.1533134392542
  }
}

Mga scheme

Ang mga kahulugan sa ibaba ay nagpapakita ng kumpletong JSON Schema na ginamit upang patunayan ang mga input at ilarawan ang mga output.

Input schema

{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "value": {
      "type": "number",
      "description": "Power value to convert. Must be finite and non-negative."
    },
    "from": {
      "type": "string",
      "enum": [
        "kw",
        "hp",
        "ps"
      ],
      "description": "Input power unit. hp is mechanical horsepower; ps is metric horsepower (PS)."
    },
    "to": {
      "type": "string",
      "enum": [
        "kw",
        "hp",
        "ps"
      ],
      "description": "Optional target unit. When omitted, all units are returned."
    }
  },
  "required": [
    "value",
    "from"
  ]
}

Output schema

{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "input": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "value": {
          "type": "number"
        },
        "from": {
          "type": "string",
          "enum": [
            "kw",
            "hp",
            "ps"
          ]
        },
        "to": {
          "type": "string",
          "enum": [
            "kw",
            "hp",
            "ps"
          ]
        }
      },
      "required": [
        "value",
        "from"
      ]
    },
    "conversions": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "kw": {
          "type": "number"
        },
        "hp": {
          "type": "number"
        },
        "ps": {
          "type": "number"
        }
      },
      "required": [
        "kw",
        "hp",
        "ps"
      ]
    },
    "result": {
      "type": "number",
      "description": "Target-unit result when a target unit is supplied."
    }
  },
  "required": [
    "input",
    "conversions"
  ]
}
API at MCP dokumentasyon