Skip to main content
Glama

Calculator

calculate
Read-onlyIdempotent

Evaluates an arithmetic expression safely (no code execution): + - * / % ^ !, parentheses, percentages like '15% * 80', and functions sqrt, abs, round, floor, ceil, ln, log, log2, exp, trig, min, max, pow, hypot, with constants pi and e. Returns the numeric result. Use it when an exact result is needed instead of mental math. Limits: no variables, symbolic algebra or units.

Input Schema

NameRequiredDescriptionDefault
expressionYese.g. (1200*0.015)/(1.2-1.15) or 15% * 80

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, closed-world), and the description adds genuinely new behavioral context: no code execution, no variables, no symbolic algebra, no units. It does not discuss precision, rounding behavior of results, or error handling for malformed input, keeping it below 5.

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?

One dense paragraph that is front-loaded with purpose and safety before the grammar and limits. The function list is long but each item is a legitimate part of the valid-input grammar; nothing is padding, though the sentence could be split for scanability.

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 no output schema present, the description closes the loop by stating 'Returns the numeric result.' For a single-parameter, annotation-covered, pure-computation tool, an agent has everything needed to invoke it correctly.

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 the single required parameter is documented, so baseline is 3. The description goes further by enumerating the accepted operator set, percentage syntax, function names (sqrt, log, trig, min/max, hypot, etc.) and constants pi/e, which is real semantic detail an agent needs to construct a valid expression.

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 and resource ('Evaluates an arithmetic expression') and immediately qualifies the mechanism ('safely (no code execution)'), which distinguishes it from any generic code or text evaluation sibling like text_tools or unit_convert.

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?

Gives a clear selection cue ('Use it when an exact result is needed instead of mental math') and a negative boundary ('no variables, symbolic algebra or units'), which implicitly routes unit conversions to unit_convert and numeric sizing to position_size. It does not name those siblings explicitly, so it falls short of a 5.

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.