Platform Agen & API Road User Tools
Konversi torsi
Konversikan antara newton meter dan pound-feet.
Antarmuka
POST
Titik akhir REST
/api/v1/torque/convertMCP
Nama alat
convert_torquePermintaan
Kirim permintaan sebagai JSON. Klien MCP meneruskan bidang yang sama dengan argumen alat.
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"
}'Permintaan tubuhjson
{
"value": 400,
"from": "nm",
"to": "lbft"
}Respon
REST membungkus hasil perhitungan dalam amplop keberhasilan standar. MCP mengembalikan data penghitungan yang sama dengan keluaran alat terstruktur.
JSON
{
"ok": true,
"data": {
"input": {
"value": 400,
"from": "nm",
"to": "lbft"
},
"conversions": {
"nm": 400,
"lbft": 295.0248597109062
},
"result": 295.0248597109062
}
}{
"ok": false,
"error": {
"code": "invalid_request",
"message": "Invalid request input."
}
}Skema
Definisi di bawah ini menunjukkan Skema JSON lengkap yang digunakan untuk memvalidasi masukan dan menjelaskan keluaran.
Skema 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"
]
}Skema 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"
]
}