ES
API & MCPDocumentación

Plataforma de agentes y API Road User Tools

Convertir potencia

Convierta entre kilovatios, caballos de fuerza mecánicos y caballos de vapor métricos (PS).

Interfaces

POST
Punto final REST/api/v1/power/convert
MCP
Nombre de la herramientaconvert_power

Solicitar

Envíe la solicitud como JSON. Los clientes MCP pasan los mismos campos que los argumentos de la herramienta.

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"
}'
Cuerpo de la solicitudjson
{
  "value": 150,
  "from": "kw",
  "to": "hp"
}

Respuesta

REST envuelve el resultado del cálculo en el sobre de éxito estándar. MCP devuelve los mismos datos de cálculo que la salida de herramienta estructurada.

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

Esquemas

Las siguientes definiciones muestran el esquema JSON completo utilizado para validar entradas y describir salidas.

Esquema de entrada

{
  "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"
  ]
}

Esquema de salida

{
  "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"
  ]
}
Documentación sobre API y MCP