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
| Field | Type | Required | What it is |
|---|---|---|---|
value | number | Yes | Value to convert |
to_unit | string | Yes | Target unit (e.g. mi, kg, °F) |
from_unit | string | Yes | Source unit (e.g. km, lb, °C) |
Output fields
How reliably each field appears in a successful answer.
| Field | Type | Appears |
|---|---|---|
value | number | Always (present in every successful answer) |
result | number | Always (present in every successful answer) |
formula | string | Always (present in every successful answer) |
to_unit | string | Always (present in every successful answer) |
category | string | Always (present in every successful answer) |
from_unit | string | Always (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
}' {
"tool": "strale_execute",
"arguments": {
"slug": "unit-convert",
"inputs": {
"value": 100,
"to_unit": "mi",
"from_unit": "km"
},
"max_price_cents": 2
}
} import { Strale } from "straleio";
const strale = new Strale({ apiKey: process.env.STRALE_API_KEY! });
const result = await strale.do({
capability_slug: "unit-convert",
inputs: {
"value": 100,
"to_unit": "mi",
"from_unit": "km"
},
max_price_cents: 2,
}); import os
from straleio import Strale, DoRequest
strale = Strale(api_key=os.environ["STRALE_API_KEY"])
result = strale.do(DoRequest(
capability_slug="unit-convert",
inputs={
"value": 100,
"to_unit": "mi",
"from_unit": "km",
},
max_price_cents=2,
)) # No account. The first request answers 402 with the price in USDC;
# an x402 client pays it from your wallet and repeats the request.
curl -i 'https://api.strale.io/x402/v2/unit-convert?value=100&to_unit=mi&from_unit=km' 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
Related tools
- Address Parser €0.05
- Company Industry Classification €0.05
- Company Name Match €0.02
- Credit Score Band €0.02
- CSV Cleaner €0.02
- CSV to JSON €0.02