Piattaforma per sviluppatori Mariner GPS Tools
Converti velocità
Converti unità di velocità
Interfacce
POST
Punto finale REST
/api/v1/speed/convertMCP
Nome dello strumento
convert_speedRichiesta
Invia la richiesta come JSON. I client MCP passano gli stessi campi degli argomenti dello strumento.
cURLshell
curl -X POST https://marinergps.tools/api/v1/speed/convert \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "content-type: application/json" \
-d '{
"value": 12,
"from": "kn",
"to": "kmh"
}'Richiedi corpojson
{
"value": 12,
"from": "kn",
"to": "kmh"
}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": 12,
"from": "kn",
"to": "kmh"
},
"conversions": {
"kn": 12,
"mph": 13.80935337628251,
"kmh": 22.224,
"ms": 6.173333333333334,
"fts": 20.253718285214347
},
"result": 22.224
}
}{
"ok": false,
"error": {
"code": "invalid_request",
"message": "Invalid request input."
}
}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": "Speed value to convert."
},
"from": {
"type": "string",
"enum": [
"kn",
"mph",
"kmh",
"ms",
"fts"
],
"description": "Input speed unit."
},
"to": {
"type": "string",
"enum": [
"kn",
"mph",
"kmh",
"ms",
"fts"
],
"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": [
"kn",
"mph",
"kmh",
"ms",
"fts"
]
},
"to": {
"type": "string",
"enum": [
"kn",
"mph",
"kmh",
"ms",
"fts"
]
}
},
"required": [
"value",
"from"
]
},
"conversions": {
"type": "object",
"additionalProperties": false,
"properties": {
"kn": {
"type": "number"
},
"mph": {
"type": "number"
},
"kmh": {
"type": "number"
},
"ms": {
"type": "number"
},
"fts": {
"type": "number"
}
},
"required": [
"kn",
"mph",
"kmh",
"ms",
"fts"
]
},
"result": {
"type": "number",
"description": "Target-unit result when a target unit is supplied."
}
},
"required": [
"input",
"conversions"
]
}