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 key to convert to, e.g. "ft", "m", "lb", "F".
fromYesUnit key to convert from, e.g. "m", "ft", "kg", "C".
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. 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 readOnly, idempotent, non-destructive and closed-world behavior, so the safety profile is covered. The description adds genuinely new context beyond that: the response returns the exact factor, an exactness-by-definition flag, and an explanatory URL — noteworthy because there is no output schema. It does not cover error behavior for unsupported units or currency attempts.

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?

Three short sentences, front-loaded with the action, then scope, then the exclusion. Every sentence carries distinct information and nothing is repeated from the title or schema.

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, no output schema, and no enums, the definition does what it must: it names the supported unit families, rules out currency, and describes what comes back (factor, exactness, URL). The one remaining gap is how an agent discovers valid unit keys and categories, which it leaves to the schema examples and sibling tools.

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%, with each parameter documented including the optional lang and category, so the schema does the heavy lifting and the baseline is 3. The description adds category-level framing (which unit families exist) but says nothing about the lang or category parameters or the disambiguation case that category exists to solve.

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?

The description opens with a specific verb and resource ("Convert a number from one unit to another") and immediately bounds the scope: linear units (length, mass, volume, energy) plus temperature, with currency deliberately excluded. An agent can distinguish this from list_categories and list_conversions 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 Guidelines4/5

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

It gives explicit when-not guidance ("Currency is deliberately not supported") and enumerates the supported categories, which is the key selection signal for a conversion tool. It stops short of routing to sibling tools, e.g. suggesting list_categories when the agent doesn't know a unit key, so it is clear context but not full alternative coverage.

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