convert_speed
Converts a numeric speed value from one unit to another. Supports SI (m/s), metric (km/h), US/UK customary (mph, ft/s), and maritime (knot).
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
value | number | Yes | Numeric value to convert. |
from | string | Yes | Source unit: ms or m/s, kmh or km/h, mph, knot, fts or ft/s |
to | string | Yes | Target unit: ms or m/s, kmh or km/h, mph, knot, fts or ft/s |
Response
| Field | Type | Description |
|---|---|---|
result | number | Converted value. |
Example
{
"value": 1,
"from": "ms",
"to": "kmh"
}
Result:
{
"result": 3.6
}
More examples
value | from | to | result |
|---|---|---|---|
100 | kmh | mph | 62.137119... |
1 | knot | kmh | 1.852 |
60 | mph | kmh | 96.56064 |
1 | m/s | ft/s | 3.28083989... |
Errors
Each failure carries a precise code in the response. Argument-schema and server errors are JSON-RPC protocol errors; a rejected value is returned as a tool result with isError: true (so the agent can read the code and self-correct).
| Code | When | Delivered as |
|---|---|---|
invalid_arguments | value is missing or not a number, or from/to is missing or not a string. | protocol error (invalid_params) |
invalid_unit | from or to is not a recognised unit. The error message lists the accepted unit strings. | tool error (isError) |
internal_error | An unexpected server error. | protocol error (internal_error) |
Notes
- Slash-notation aliases are supported:
m/s=ms,km/h=kmh,ft/s=fts. knotis the international knot (1 852 m/h).- All results are 64-bit floating-point numbers.