Skip to main content
Glama
laszlopere

mcp-gnu-units

convert

Convert a value from one unit to another across all measurement categories. Supports compound expressions and returns the converted magnitude with unit and exactness flag.

Instructions

Convert a value or unit expression from one unit to another (GNU units engine, TODO §16).

The universal conversion core: one tool covers every category (length, mass, time, temperature, area, volume, energy, power, speed, data, …) plus compound expressions like kW*h or acre*ft. Linear conversions return the ratio of coefficients; a nonlinear target (e.g. tempF) applies that unit's inverse.

Returns: from and to (echoed), result (the converted magnitude WITH the target unit, e.g. "1.609344 km" — the primary human-readable answer), value (the same magnitude as a bare float for programmatic use), and exact (true when the result is exact, false when it was rounded). Errors cleanly (isError) when a unit is unknown, an expression is malformed, or the two sides are not conformable. Example: convert("1 mile", "km") -> {"from":"1 mile","to":"km","result":"1.609344 km","value":1.609344,"exact":true}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
to_exprYesThe unit expression to convert TO, e.g. 'km', 'gallons', 'joule', 'tempF'. Must be dimensionally conformable with `from_expr` (both length, both energy, …) or a nonlinear target such as 'tempF'; otherwise the call errors. Use find_units to discover the exact spelling of a unit.
from_exprYesThe quantity or unit expression to convert FROM. May carry a numeric coefficient and be a compound expression: '2.5 acre*ft', '55 mile/hour', 'kW*h', '0 tempC'. A bare unit like 'mile' is treated as one of that unit.
Behavior5/5

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

No annotations provided, so description carries full burden. Clearly explains linear vs nonlinear behavior, return fields (from, to, result, value, exact), error handling (unknown unit, malformed expression, non-conformable), and provides a concrete example. Fully transparent.

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?

Description is well-structured and concise. Front-loaded with purpose, followed by behavior, return values, error handling, and example. No unnecessary words.

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?

For a tool with 2 params fully described in schema and no output schema, the description covers input, output, error cases, and an example completely. Fits the complexity well.

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 description coverage is 100%. The description adds significant meaning beyond the schema: explains that from_expr can carry a numeric coefficient and compound expressions, to_expr must be dimensionally conformable or a nonlinear target, and suggests using find_units for exact spelling.

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?

Clearly states verb 'convert' and resource 'value or unit expression'. Distinguishes from sibling tools by calling itself 'the universal conversion core' covering all categories, which sets it apart from convert_to_si, find_units, etc.

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?

Describes the tool as the universal conversion core and implicitly covers when to use it. Mentions find_units for discovering unit spelling, hinting at alternatives. Could be more explicit about when to use convert_to_si, but still provides useful context.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/laszlopere/mcp-gnu-units'

If you have feedback or need assistance with the MCP directory API, please join our Discord server