Unit Converter

Convert length, weight, volume, temperature, area, speed and data size.

Pay by wallet (x402) unit-convert

Example

Input
{
  "value": 100,
  "to_unit": "mi",
  "from_unit": "km"
}
Answer
{
  "value": 100,
  "result": 62.1371,
  "formula": "km → m → mi",
  "to_unit": "mi",
  "category": "length",
  "from_unit": "km"
}

Inputs

FieldTypeRequiredWhat it is
valuenumberYesValue to convert
to_unitstringYesTarget unit (e.g. mi, kg, °F)
from_unitstringYesSource unit (e.g. km, lb, °C)

Output fields

How reliably each field appears in a successful answer.

FieldTypeAppears
valuenumberAlways (present in every successful answer)
resultnumberAlways (present in every successful answer)
formulastringAlways (present in every successful answer)
to_unitstringAlways (present in every successful answer)
categorystringAlways (present in every successful answer)
from_unitstringAlways (present in every successful answer)

How to call it

The same tool through each route. MCP clients reach it through Strale’s server at https://api.strale.io/mcp; the call below is what the agent sends.

# Needs an API key. max_price_cents caps what this call may cost.
curl -X POST https://api.strale.io/v1/do \
  -H "Authorization: Bearer $STRALE_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "capability_slug": "unit-convert",
    "inputs": {
      "value": 100,
      "to_unit": "mi",
      "from_unit": "km"
    },
    "max_price_cents": 2
  }'

Limitations

  • Specialist unit categories are not supported

    Covers common unit categories (length, weight, volume, temperature, speed) — specialized units (e.g., radiation, magnetic flux) not supported

    What to do instead: For unsupported unit types, use the conversion factor directly in your application logic