Skip to main content
Glama
laszlopere

mcp-gnu-units

define_unit

Look up a unit's definition, kind, dimension, and base value from the GNU units database. Ideal for inspecting what a unit reduces to.

Instructions

Show a single unit/prefix/constant's definition, kind, dimension, and base value (TODO §13).

Looks up one name in the GNU units database and reports exactly what it is and what it reduces to — the inspect/"define" counterpart to convert. Works for ordinary units, SI/binary prefixes, physical constants, nonlinear function units (tempF), and piecewise tables (brwiregauge).

Returns an object with:

  • name : echoed.

  • kind : "unit" | "primitive" | "prefix" | "function" | "table".

  • definition : the database definition text (source line, leading name token removed). "!" marks a primitive/base unit.

  • dimension : base-unit signature, e.g. "kg m^2 / s^3" for power; "1" when dimensionless. Omitted for hits that do not reduce.

  • base_value : the unit reduced to base units with its coefficient, e.g. "745.699871582 kg m^2 / s^3". Omitted alongside dimension.

  • function : for nonlinear units only — {signature, input_dimensions, output_dimension} describing the conversion function.

Errors cleanly (isError) when the name is not defined in the database. Example: define_unit("newton") -> {"name":"newton","kind":"unit","definition":"kg m / s^2", "base_value":"1 kg m / s^2","dimension":"kg m / s^2"}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesThe exact name of a single unit, prefix, physical constant, function, or table to look up — e.g. 'horsepower', 'kilo', 'newton', 'tempF', 'brwiregauge'. This is a definition lookup, not an expression evaluator: pass one database name, not a compound expression like 'kW*hour'. Use find_units first if you are unsure of the exact spelling.
Behavior5/5

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

No annotations are provided, so the description carries full burden. It thoroughly describes the return object fields (name, kind, definition, dimension, base_value, function), explains cases where fields are omitted (non-reducing hits), covers error handling (cleanly with isError), and details the function output for nonlinear units. This fully discloses behavioral traits.

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 appropriately sized for the complexity: a concise one-line summary, then structured elaboration. Every sentence adds value—examples, field explanations, error behavior, and usage notes. No redundancy, no wasted words. It is well-organized and easy to parse.

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 no output schema, the description fully and clearly documents the return object, including all possible fields, their meanings, and conditions for omission. The parameter is thoroughly explained with examples. Error handling is described. The tool's place among siblings is clear. The description leaves no significant gaps for an AI agent to select and invoke correctly.

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

Parameters5/5

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

The single required parameter 'name' has a schema description that adds context: 'exact name', 'not an expression', and advice to use 'find_units' for uncertain spelling. The tool description reinforces this with examples of valid names. Schema coverage is 100%, and the description adds complementary meaning, making parameter semantics very clear.

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 starts with a clear one-liner 'Show a single unit/prefix/constant's definition, kind, dimension, and base value', specifying verb and resource. It explicitly distinguishes from sibling 'convert' and 'find_units', and provides examples like 'newton' and 'tempF', making the purpose unmistakable.

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

Usage Guidelines5/5

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

The description states what types of names are accepted (units, prefixes, constants, functions, tables) and explicitly tells when to use 'find_units' for uncertain spelling. It contrasts with 'convert' by stating it is the 'inspect/define counterpart'. There is clear guidance on when to use and when not to use (e.g., not for compound expressions).

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