NL
API & MCPDocumentatie

Road User Tools agent- en API-platform

Koppel converteren

Converteer tussen newtonmeter en pound-feet.

Interfaces

POST
REST-eindpunt/api/v1/torque/convert
MCP
Naam van het gereedschapconvert_torque

Verzoek

Verzend het verzoek als JSON. MCP-clients geven dezelfde velden door als toolargumenten.

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"
}'
Lichaam aanvragenjson
{
  "value": 400,
  "from": "nm",
  "to": "lbft"
}

Reactie

REST verpakt het berekeningsresultaat in de standaard succesenvelop. MCP retourneert dezelfde berekeningsgegevens als de gestructureerde gereedschapsuitvoer.

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

Schema's

De onderstaande definities tonen het volledige JSON-schema dat wordt gebruikt om invoer te valideren en uitvoer te beschrijven.

Invoerschema

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

Uitvoerschema

{
  "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"
  ]
}
API- en MCP-documentatie