IT
API & MCPDocumentazione

Piattaforma per agenti e API Road User Tools

Converti la coppia

Converti tra newton metri e libbre-piede.

Interfacce

POST
Punto finale REST/api/v1/torque/convert
MCP
Nome dello strumentoconvert_torque

Richiesta

Invia la richiesta come JSON. I client MCP passano gli stessi campi degli argomenti dello strumento.

cURLshell
curl -X POST https://roaduser.tools/api/v1/torque/convert \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "content-type: application/json" \
  -d '{
  "value": 400,
  "from": "nm",
  "to": "lbft"
}'
Richiedi corpojson
{
  "value": 400,
  "from": "nm",
  "to": "lbft"
}

Risposta

REST racchiude il risultato del calcolo nella busta di successo standard. MCP restituisce gli stessi dati di calcolo dell'output strutturato dello strumento.

JSON
{
  "ok": true,
  "data": {
    "input": {
      "value": 400,
      "from": "nm",
      "to": "lbft"
    },
    "conversions": {
      "nm": 400,
      "lbft": 295.0248597109062
    },
    "result": 295.0248597109062
  }
}

Schemi

Le definizioni seguenti mostrano lo schema JSON completo utilizzato per convalidare gli input e descrivere gli output.

Schema di input

{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "value": {
      "type": "number",
      "description": "Torque value to convert. Must be finite and non-negative."
    },
    "from": {
      "type": "string",
      "enum": [
        "nm",
        "lbft"
      ],
      "description": "Input torque unit."
    },
    "to": {
      "type": "string",
      "enum": [
        "nm",
        "lbft"
      ],
      "description": "Optional target unit. When omitted, all units are returned."
    }
  },
  "required": [
    "value",
    "from"
  ]
}

Schema di output

{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "input": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "value": {
          "type": "number"
        },
        "from": {
          "type": "string",
          "enum": [
            "nm",
            "lbft"
          ]
        },
        "to": {
          "type": "string",
          "enum": [
            "nm",
            "lbft"
          ]
        }
      },
      "required": [
        "value",
        "from"
      ]
    },
    "conversions": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "nm": {
          "type": "number"
        },
        "lbft": {
          "type": "number"
        }
      },
      "required": [
        "nm",
        "lbft"
      ]
    },
    "result": {
      "type": "number",
      "description": "Target-unit result when a target unit is supplied."
    }
  },
  "required": [
    "input",
    "conversions"
  ]
}
Documentazione API e MCP