Skip to main content
Glama

compute

Evaluate numeric expressions to get exact rational fractions and decimal values, eliminating arithmetic rounding errors in AI reasoning.

Instructions

Compute the exact rational fraction and decimal value of a numeric expression using zero-drift AST rational arithmetic.

Input Schema

NameRequiredDescriptionDefault
exprYesMathematical expression to evaluate (e.g., '(144 / 12) + 7').

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations at all, the description carries the full burden, and it does disclose a meaningful trait: 'zero-drift AST rational arithmetic' tells the agent results are exact rather than floating-point. It stops short of covering failure behavior for malformed expressions, operator support, or limits on expression size, which matters for an unannotated evaluation tool.

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?

A single sentence that front-loads the action and ends with the distinguishing precision claim. Nothing is repeated from the title or name, and there is no filler.

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?

For a one-parameter tool with no output schema, the description is nearly sufficient: it explains both what goes in and what comes back (fraction and decimal). The only real gap is error/precision edge-case behavior, which is modest for a tool this simple.

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 coverage is 100%, and the schema's own example ('(144 / 12) + 7') already illustrates the accepted syntax, so the baseline of 3 applies. The description adds the notion that the expression is parsed as an AST and evaluated rationally, but no further syntax rules beyond what the schema provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (compute) and resource (a numeric expression), and goes further by naming the output shape: exact rational fraction plus decimal. It doesn't distinguish itself from the sibling solve_equation, so an agent still has to guess whether an expression with a variable belongs here or there.

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

Usage Guidelines2/5

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

The description never says when to reach for this versus solve_equation or verify_step, and gives no preconditions on expression syntax. Usage must be inferred purely from the word 'numeric expression,' which is not enough given an overlapping sibling.

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