Skip to main content
Glama

Unit Converter

calc_units
Read-onlyIdempotent

Convert measurements across length, weight, and temperature unit types. Enter a value, source unit, and target unit to get instant conversions like km to miles or lb to kg.

Instructions

Convert between different units of measurement.

Supported unit types:

  • length: mm, cm, m, km, in, ft, yd, mi

  • weight: g, kg, oz, lb

  • temperature: c, f, k (Celsius, Fahrenheit, Kelvin)

Examples: convert_units(5, "km", "mi", "length") # 5 kilometers → 3.11 miles convert_units(150, "lb", "kg", "weight") # 150 pounds → 68.04 kilograms

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
valueYesNumeric value to convert, e.g., 100.0
to_unitYesTarget unit abbreviation. Valid units depend on unit_type: length (mm, cm, m, km, in, ft, yd, mi), weight (g, kg, oz, lb), temperature (c, f, k)
from_unitYesSource unit abbreviation. Valid units depend on unit_type: length (mm, cm, m, km, in, ft, yd, mi), weight (g, kg, oz, lb), temperature (c, f, k)
unit_typeYesUnit category: length, weight, or temperature

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
topicYes
valueYes
to_unitYes
from_unitYes
unit_typeYes
difficultyYes
converted_valueYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.12.1

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and idempotentHint=true, so the safety profile is clear. The description adds domain context (supported units and example outputs) without contradicting annotations. It doesn't discuss error handling for unsupported unit combinations, but that's a minor gap for a pure conversion function.

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?

The description is well-structured: a concise opening, bullet-pointed unit categories, and two practical examples. It is front-loaded with the purpose, and every sentence contributes. The only minor issue is the example uses a different function name, but this doesn't detract from clarity.

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?

Given the presence of an output schema, the description doesn't need to explain return values. The schema fully documents all parameters, and the description covers supported units and provides usage examples. For a straightforward conversion tool, this is complete and sufficient for an agent to select and invoke it correctly.

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 all four parameters (value, from_unit, to_unit, unit_type) fully documented including valid units. The description's unit lists largely duplicate schema content; the only extra is concrete examples, though they use 'convert_units' instead of the tool name 'calc_units'.

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 clearly states the tool converts units of measurement and lists supported unit types (length, weight, temperature) with specific units. This specific verb+resource (convert units) distinguishes it from sibling calculation tools like calc_interest or matrix operations.

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 description provides clear context by listing supported unit types and examples, making it obvious when to use this tool. However, it doesn't explicitly mention when not to use it or recommend alternatives among siblings, but the intent is unambiguous.

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