Ardán Gníomhairí agus API Road User Tools
Tiontaigh faid
Tiontaigh idir ciliméadar, méadar, míle, slat, agus cosa.
Comhéadain
POST
Críochphointe REST
/api/v1/distance/convertMCP
Ainm uirlise
convert_distanceIarratas
Seol an t-iarratas mar JSON. Pasann cliaint MCP na réimsí céanna le hargóintí uirlisí.
cURLshell
curl -X POST https://roaduser.tools/api/v1/distance/convert \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "content-type: application/json" \
-d '{
"value": 10,
"from": "km",
"to": "mi"
}'Comhlacht iarrataisjson
{
"value": 10,
"from": "km",
"to": "mi"
}Freagra
Fillteann REST an toradh ríofa sa chlúdach caighdeánach rathúlachta. Tugann MCP na sonraí ríofa céanna ar ais agus aschur uirlisí struchtúrtha.
JSON
{
"ok": true,
"data": {
"input": {
"value": 10,
"from": "km",
"to": "mi"
},
"conversions": {
"km": 10,
"m": 10000,
"mi": 6.2137119223733395,
"yd": 10936.132983377078,
"ft": 32808.39895013123
},
"result": 6.2137119223733395
}
}{
"ok": false,
"error": {
"code": "invalid_request",
"message": "Invalid request input."
}
}Scéimeanna
Léiríonn na sainmhínithe thíos Scéimre JSON iomlán a úsáidtear chun ionchuir a bhailíochtú agus chun cur síos a dhéanamh ar aschuir.
Scéimre ionchuir
{
"type": "object",
"additionalProperties": false,
"properties": {
"value": {
"type": "number",
"description": "Distance value to convert. Must be finite and non-negative."
},
"from": {
"type": "string",
"enum": [
"km",
"m",
"mi",
"yd",
"ft"
],
"description": "Input distance unit."
},
"to": {
"type": "string",
"enum": [
"km",
"m",
"mi",
"yd",
"ft"
],
"description": "Optional target unit. When omitted, all units are returned."
}
},
"required": [
"value",
"from"
]
}Scéimre aschuir
{
"type": "object",
"additionalProperties": false,
"properties": {
"input": {
"type": "object",
"additionalProperties": false,
"properties": {
"value": {
"type": "number"
},
"from": {
"type": "string",
"enum": [
"km",
"m",
"mi",
"yd",
"ft"
]
},
"to": {
"type": "string",
"enum": [
"km",
"m",
"mi",
"yd",
"ft"
]
}
},
"required": [
"value",
"from"
]
},
"conversions": {
"type": "object",
"additionalProperties": false,
"properties": {
"km": {
"type": "number"
},
"m": {
"type": "number"
},
"mi": {
"type": "number"
},
"yd": {
"type": "number"
},
"ft": {
"type": "number"
}
},
"required": [
"km",
"m",
"mi",
"yd",
"ft"
]
},
"result": {
"type": "number",
"description": "Target-unit result when a target unit is supplied."
}
},
"required": [
"input",
"conversions"
]
}