Convert values between metric, imperial and other units
unitsConvert a value between units of length, area, volume (US customary and metric, cooking measures), mass, speed, pressure, energy, power, data size (SI and binary), time and temperature. Factors are exact to the definitions in NIST SP 811 (international inch and pound, US gallon, calorie IT, Btu IT, mechanical horsepower). An unknown unit is a 400 that lists every supported unit. Pure code, no outside source. Price: $0.002 per successful call, paid with x402 (USDC on Base, Solana and 10 more networks); failed calls are not charged.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"value": "<value>",
"from": "<from>",
"to": "<to>"
},
"name": "units"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | Unit to convert to, of the same kind, e.g. km, lb, C, MB | |
| from | Yes | Unit to convert from, e.g. mi, kg, F, GiB, kWh, gal_us | |
| value | Yes | The number to convert, up to 1e15 in size |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | ||
| from | No | ||
| value | No | ||
| family | No | ||
| result | No | ||
| source | No | ||
| checkedAt | No |