Skip to main content

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​

ParameterTypeRequiredDescription
valuenumberYesNumeric value to convert.
fromstringYesSource unit: ms or m/s, kmh or km/h, mph, knot, fts or ft/s
tostringYesTarget unit: ms or m/s, kmh or km/h, mph, knot, fts or ft/s

Response​

FieldTypeDescription
resultnumberConverted value.

Example​

{
"value": 1,
"from": "ms",
"to": "kmh"
}

Result:

{
"result": 3.6
}

More examples​

valuefromtoresult
100kmhmph62.137119...
1knotkmh1.852
60mphkmh96.56064
1m/sft/s3.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).

CodeWhenDelivered as
invalid_argumentsvalue is missing or not a number, or from/to is missing or not a string.protocol error (invalid_params)
invalid_unitfrom or to is not a recognised unit. The error message lists the accepted unit strings.tool error (isError)
internal_errorAn unexpected server error.protocol error (internal_error)

Notes​

  • Slash-notation aliases are supported: m/s = ms, km/h = kmh, ft/s = fts.
  • knot is the international knot (1 852 m/h).
  • All results are 64-bit floating-point numbers.