Unit Conversion MCP Tools for AI Agents

Your agent converts 98.6°F to Celsius and says 37.1°C. Close — but it's exactly 37.0°C. For medical, scientific, or engineering agents, "close enough" is not enough. These tools use exact conversion factors for every unit pair.

All Conversion Tools (42)

Your agent gets access to 42 conversion tools via the /mcp/convert/ endpoint. Here's the complete list:

ToolDescription
convert/temperature/c-to-fCelsius To Fahrenheit
convert/temperature/f-to-cFahrenheit To Celsius
convert/temperature/c-to-kCelsius To Kelvin
convert/temperature/k-to-cKelvin To Celsius
convert/length/m-to-ftMeters To Feet
convert/length/ft-to-mFeet To Meters
convert/length/km-to-miKilometers To Miles
convert/length/mi-to-kmMiles To Kilometers
convert/length/in-to-cmInches To Centimeters
convert/length/cm-to-inCentimeters To Inches
convert/weight/kg-to-lbKilograms To Pounds
convert/weight/lb-to-kgPounds To Kilograms
convert/weight/oz-to-gOunces To Grams
convert/weight/g-to-ozGrams To Ounces
convert/weight/stone-to-kgStone To Kilograms
convert/volume/l-to-gal-usLiters To Gallons Us
convert/volume/gal-us-to-lGallons Us To Liters
convert/volume/l-to-gal-ukLiters To Gallons Uk
convert/volume/gal-uk-to-lGallons Uk To Liters
convert/volume/ml-to-fl-ozMilliliters To Fluid Ounces
convert/volume/cups-to-mlCups To Milliliters
convert/volume/ml-to-cupsMilliliters To Cups
convert/area/sqm-to-sqftSquare Meters To Square Feet
convert/area/sqft-to-sqmSquare Feet To Square Meters
convert/area/acres-to-hectaresAcres To Hectares
convert/speed/mph-to-kphMph To Kph
convert/speed/kph-to-mphKph To Mph
convert/speed/mps-to-mphMeters Per Second To Mph
convert/speed/knots-to-kphKnots To Kph
convert/data/bytes-to-humanBytes To Human
convert/data/kb-to-mbKilobytes To Megabytes
convert/data/mb-to-gbMegabytes To Gigabytes
convert/base/dec-to-binDecimal To Binary
convert/base/bin-to-decBinary To Decimal
convert/base/dec-to-hexDecimal To Hexadecimal
convert/base/hex-to-decHexadecimal To Decimal
convert/base/dec-to-octDecimal To Octal
convert/color/hex-to-rgbHex To Rgb
convert/color/rgb-to-hexRgb To Hex
convert/time/hours-to-minutesHours To Minutes
convert/time/minutes-to-secondsMinutes To Seconds
convert/time/seconds-to-hmsSeconds To Hms

Agent Scenarios

Here's how real agents use these tools:

1. Recipe scaling agent

A cooking agent converts 2 cups to milliliters for an international user. convert/cups-to-ml returns the exact value.

Tool Call: convert/cups-to-ml
{ "cups": 2 }

2. Fitness tracking agent

A health agent converts a user's weight from pounds to kilograms for BMI calculation. convert/lb-to-kg ensures precision.

Tool Call: convert/lb-to-kg
{ "lb": 165 }

3. DevOps monitoring agent

An infrastructure agent converts disk usage from bytes to human-readable GB. convert/bytes-to-gb handles the math correctly.

Tool Call: convert/bytes-to-gb
{ "bytes": 1099511627776 }

MCP Setup

Add conversion tools to your agent in under 2 minutes. Choose your client:

Claude Desktop / Claude Code

Add this to your MCP config:

{
  "mcpServers": {
    "tinyfn-convert": {
      "url": "https://api.tinyfn.io/mcp/convert/",
      "headers": {
        "X-API-Key": "your-api-key"
      }
    }
  }
}

Cursor

Go to Settings > MCP and add a new server:

  • Type: SSE
  • URL: https://api.tinyfn.io/mcp/convert/sse
  • Headers: X-API-Key: your-api-key

Tip: Use the category-specific endpoint (/mcp/convert/) for the best experience. The all-in-one endpoint (/mcp/all/) works too but has 500+ tools which some clients handle less efficiently.

When to Use These Tools

Use conversion MCP tools when your agent needs to:

  • Guarantee correctness — when wrong answers have real consequences
  • Process user data — when you're operating on actual user input, not hypothetical examples
  • Maintain consistency — when the same input must always produce the same output

You don't need these tools for casual conversation or rough estimates. Use them when precision matters.

Ready to add conversion tools to your agent?

Get Free API Key 100 requests/month free. No credit card required.

Frequently Asked Questions

Why do LLMs get unit conversions wrong?

LLMs memorize approximate conversion factors and apply them inconsistently. They confuse US and imperial gallons, use rounded values for precise conversions, and often fail multi-step conversions.

How many conversion types does TinyFn support?

TinyFn supports 50+ unit conversions across temperature, length, weight, volume, area, speed, data sizes, and number bases.

Does TinyFn handle UK vs US unit differences?

Yes. TinyFn correctly distinguishes between US and imperial gallons, US and imperial fluid ounces, and other regional unit variations.

Ready to try TinyFn?

Get your free API key and start building in minutes.

Get Free API Key