Skip to main content
Glama

Convert values between metric, imperial and other units

units
Read-only

Convert a value between units of length, area, volume (US customary and metric, cooking measures), mass, speed, pressure, energy, power, data size (SI and binary), time and temperature. Factors are exact to the definitions in NIST SP 811 (international inch and pound, US gallon, calorie IT, Btu IT, mechanical horsepower). An unknown unit is a 400 that lists every supported unit. Pure code, no outside source. Price: $0.002 per successful call, paid with x402 (USDC on Base, Solana and 10 more networks); failed calls are not charged.

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

Input Schema

NameRequiredDescriptionDefault
toYesUnit to convert to, of the same kind, e.g. km, lb, C, MB
fromYesUnit to convert from, e.g. mi, kg, F, GiB, kWh, gal_us
valueYesThe number to convert, up to 1e15 in size

Output Schema

NameRequiredDescriptionDefault
toNo
fromNo
valueNo
familyNo
resultNo
sourceNo
checkedAtNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

Beyond readOnlyHint/openWorldHint it discloses factor provenance and exactness (NIST SP 811, international inch/pound, US gallon, calorie IT, Btu IT, mechanical horsepower), failure semantics (a 400 enumerating all supported units), that it is pure code with no external source, and pricing/charging behavior ($0.002 per successful call via x402, failures not charged). The billing detail is exactly the kind of behavioral fact annotations cannot express. Minor tension: 'pure code, no outside source' sits awkwardly beside openWorldHint=true, though the description is the more precise of the two.

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

Conciseness4/5

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

Four sentences, front-loaded with scope, then precision guarantees, then error behavior, then cost. Every sentence is load-bearing, though the parenthetical standards list (international inch and pound, US gallon, calorie IT, Btu IT) is denser than most agents need.

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?

With an output schema present, return values need no explanation, and all three required parameters have schema descriptions. The remaining agent-relevant unknowns, supported unit universe, numerical exactness, failure mode, and cost, are all covered.

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 already gives per-parameter examples, so the baseline is 3. The description adds unit-naming help beyond the schema: it establishes that any unit string from the stated families is valid and that an unknown one returns a 400 containing the full supported list, which lets the agent self-correct rather than guess.

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 (convert) plus the exact resource domain, enumerating the measurement families covered: length, area, volume, mass, speed, pressure, energy, power, data size, time, temperature. The enumeration itself separates it from siblings like crypto_convert, since no currency or asset conversion is in scope.

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 category list makes the applicable context clear, and the '400 that lists every supported unit' note tells the agent how to recover from an invalid unit. It never names an alternative tool or an exclusion (e.g., currency goes elsewhere), so it stays at clear-context rather than full when/when-not guidance.

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