Convert units of length, weight and more from an AI agent

You need to convert an amount between units, such as miles to kilometers, and want the exact value rather than a rounded factor from memory.

Use length-convert@1.0.0. It is free and needs no key or sign-up. Convert a canonical integer length between exact SI and international customary units.

Why call a tool for this

The result is an exact fraction, so no rounding happens unless you choose it. For example, value 5 from mi to km returns numerator 25146 and denominator 3125, which is 8.04672 km.

Call it over HTTP

curl -X POST https://computefirst.net/v1/tools/length-convert/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"value":"1","from":"ft","to":"in"}'

Response:

{
  "result": {
    "numerator": "12",
    "denominator": "1"
  }
}

Call it over MCP

Connect https://computefirst.net/mcp (setup), then call execute with:

{
  "id": "length-convert",
  "version": "1.0.0",
  "input": {
    "value": "1",
    "from": "ft",
    "to": "in"
  }
}

Check the result

length-convert takes a whole number as a string and returns numerator and denominator. To convert 26.2 miles, convert 262 and divide the result by 10. Each kind of unit has its own tool: see the list below. There is no tool yet for data rates such as MB/s to Mbit/s, or for formatting seconds as hh:mm:ss.

Full contract, limits and unsupported cases: Length convert.