Skip to main content
Glama

Convert a value between units

convert_units
Read-onlyIdempotent

Convert a number from one unit to another and return the exact factor, whether the factor is exact by definition, and the URL of the page that explains it. Supports linear units (length, mass, volume, energy, …) and temperature. Currency is deliberately not supported.

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 — key ("ft", "lb", "F") or natural name ("foot", "pounds", "fahrenheit").
fromYesUnit to convert from — key ("m", "kg", "C") or natural name ("meter", "feet", "celsius").
langNoOptional language for the framing lines of the response, as a BCP-47 tag such as "sv", "sv-SE", "de" or "zh-TW". Pass the language you are answering the user in, so the citation line comes back in that language. Values, unit symbols and the URL are always unchanged.
valueYesThe number to convert.
categoryNoOptional category id (length, mass, volume, …). Only needed when the same unit key exists in more than one category.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / from / description
      Previous value: -"Unit key to convert from, e.g. \"m\", \"ft\", \"kg\", \"C\"."New value: +"Unit to convert from — key (\"m\", \"kg\", \"C\") or natural name (\"meter\", \"feet\", \"celsius\")."
    • changedInput schema / properties / to / description
      Previous value: -"Unit key to convert to, e.g. \"ft\", \"m\", \"lb\", \"F\"."New value: +"Unit to convert to — key (\"ft\", \"lb\", \"F\") or natural name (\"foot\", \"pounds\", \"fahrenheit\")."
  2. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, openWorldHint=false and destructiveHint=false, so safety is covered. The description adds genuinely new behavior: the response carries the conversion factor, a flag for whether that factor is exact by definition, and a documentation URL — important since there is no output schema. It does not cover invalid/unknown unit handling or the fact that temperature conversions are affine rather than a single multiplicative factor, which is a notable gap given the "exact factor" framing.

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

Conciseness5/5

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

Two sentences, no filler, and the most decision-relevant information (what it returns) is front-loaded before the scope constraints. The trailing "Currency is deliberately not supported" line earns its place as a routing filter.

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

Completeness4/5

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

With five parameters, full schema coverage, complete annotations and no output schema, the description covers purpose, return shape, and scope well enough to call the tool correctly. What's missing is edge-case behavior — unknown units, ambiguous keys across categories, and how temperature values are treated — which matters slightly more here because the description promises an "exact factor".

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

Parameters3/5

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

Schema description coverage is 100% and each parameter already documents its accepted forms (unit key or natural name, BCP-47 lang tag, optional category id). The description adds nothing parameter-specific — it never mentions lang or category — so the baseline 3 applies with the schema doing all the work.

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?

"Convert a number from one unit to another" names a specific verb and resource, and the sentence continues by naming the three things returned (factor, exactness flag, explanation URL) plus the supported domain (linear units and temperature, explicitly not currency). An agent can distinguish this from list_categories/list_conversions purely from the description.

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

Usage Guidelines4/5

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

The scope boundary is explicit — "Supports linear units (length, mass, volume, energy, …) and temperature. Currency is deliberately not supported." — which tells the agent a whole class of requests should not route here. However, it never names the sibling tools (e.g. list_conversions/list_categories) or says when to use those instead, so the when-not side is covered but the alternatives side is not.

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