Skip to main content
Glama

convert_units

Read-onlyIdempotent

utilpeek: Convert units of measurement: length, weight, temperature, volume, pressure, energy, data size. For numbers in words use text_numbers. Returns a value converted between two units of one category, with the exact factor: length, mass, temperature (with offsets), volume, area, speed, pressure, energy, power, data size (kB = 1000 bytes, KiB = 1024) and rate, time, frequency, angle and fuel economy (reciprocal). Cross-category or unknown units, ambiguous spellings (KB), temperatures below absolute zero and 0 into a reciprocal fuel unit are a 422 before any payment (not charged). gal, qt, pt, cup and fl_oz are US; the imperial ones end in _imp. Typically under 0.1 s. Price: USD 0.001. Free: 10 utilpeek calls per IP per UTC day. Docs: https://tanod.dev/learn/unit-conversion-api.html

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": "convert_units"
  }
}

Input Schema

NameRequiredDescriptionDefault
toYesUnit to convert to, of the same category as `from`.
fromYesUnit to convert from: a symbol or name such as in, ft, mi, kg, lb, C, F, K, L, gal, gal_imp, m2, acre, km/h, mph, kn, psi, inHg, atm, kWh, BTU, eV, hp, kB, KiB, Mbit, h, L/100km, mpg, mpg_imp. Case matters only where it must (kB vs kb, MB vs Mb).
valueYesThe number to convert (at most 1e300 in magnitude).

Output Schema

NameRequiredDescriptionDefault
toNo
fromNo
kindNo
errorNoOnly on an error result: an object {code, message}, or the reason string of an x402 PaymentRequired object.
valueNo
factorNo
offsetNo
resultNo
formulaNo
to_nameNo
categoryNo
from_nameNo
factor_exactNo
offset_exactNo
factor_decimalNo
offset_decimalNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / properties / category / enum
      Previous value: -[
      -  "length",
      -  "mass",
      -  "temperature",
      -  "volume",
      -  "area",
      -  "speed",
      -  "pressure",
      -  "energy",
      -  "power",
      -  "data",
      -  "time",
      -  "fuel_economy",
      -  null
      -]New value: +[
      +  "length",
      +  "mass",
      +  "temperature",
      +  "volume",
      +  "area",
      +  "speed",
      +  "pressure",
      +  "energy",
      +  "power",
      +  "data",
      +  "time",
      +  "fuel_economy",
      +  "angle",
      +  "frequency",
      +  "data_rate",
      +  null
      +]
  2. Changed4 schema fields changed
    • removedInput schema / properties / from / title
      Removed value: -"From"
    • removedInput schema / properties / to / title
      Removed value: -"To"
    • removedInput schema / properties / value / title
      Removed value: -"Value"
    • removedInput schema / title
      Removed value: -"convert_unitsArguments"
  3. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "category": {
      +      "enum": [
      +        "length",
      +        "mass",
      +        "temperature",
      +        "volume",
      +        "area",
      +        "speed",
      +        "pressure",
      +        "energy",
      +        "power",
      +        "data",
      +        "time",
      +        "fuel_economy",
      +        null
      +      ],
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "error": {
      +      "description": "Only on an error result: an object {code, message}, or the reason string of an x402 PaymentRequired object."
      +    },
      +    "factor": {
      +      "type": [
      +        "number",
      +        "null"
      +      ]
      +    },
      +    "factor_decimal": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "factor_exact": {
      +      "type": [
      +        "boolean",
      +        "null"
      +      ]
      +    },
      +    "formula": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "from": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "from_name": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "kind": {
      +      "enum": [
      +        "multiply",
      +        "affine",
      +        "reciprocal",
      +        null
      +      ],
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "offset": {
      +      "type": [
      +        "number",
      +        "null"
      +      ]
      +    },
      +    "offset_decimal": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "offset_exact": {
      +      "type": [
      +        "boolean",
      +        "null"
      +      ]
      +    },
      +    "result": {
      +      "type": [
      +        "number",
      +        "null"
      +      ]
      +    },
      +    "to": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "to_name": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "value": {
      +      "type": [
      +        "number",
      +        "null"
      +      ]
      +    }
      +  },
      +  "type": "object"
      +}
  4. Added

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already cover safety (readOnly, idempotent, non-destructive, closed-world), and the description adds substantial context on top: pre-payment validation with no charge on 422, typical latency under 0.1 s, USD 0.001 price and a 10-calls-per-IP-per-day free tier. It also discloses precision semantics ("with the exact factor") and the offset handling for temperature, which an agent cannot infer from annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded and information-dense, but the unit categories are enumerated twice in the opening sentences (once as a short list, once as a longer overlapping list including area, speed, power, rate, time, frequency, angle, fuel economy), which is avoidable repetition. The middle is a run-on chain of clauses (error cases, units convention, latency, pricing, docs link) with no structure separating the concerns.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return-value explanation is not required; the description still characterizes the return as an exact-factor conversion. Combined with error taxonomy, unit-naming conventions, cost model, and latency, everything needed to call it correctly and predict failures is present.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% and the schema already documents `from`/`to`/`value` thoroughly, so the baseline is 3. The description earns an increment by adding behavioral meaning the schema does not: conversions must stay within one category, temperature uses offsets, kB = 1000 vs KiB = 1024, and fuel economy is reciprocal with 0 being an error.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ("Convert units of measurement") and enumerates the supported categories, so an agent knows exactly what the tool covers. It also names the sibling it is not for numbers-in-words ("use text_numbers"), which disambiguates without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives an explicit routing rule ("For numbers in words use text_numbers") and spells out the invalid-input conditions that route to a 422: cross-category or unknown units, ambiguous spellings such as KB, sub-absolute-zero temperatures, and 0 into a reciprocal fuel unit. The US vs _imp convention for gal/qt/pt/cup/fl_oz removes a real ambiguity an agent would otherwise hit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources