Skip to main content
Glama

Exact calculator

calculate
Read-onlyIdempotent

Evaluates an arithmetic expression exactly, so you don't have to do mental math. Supports + - * / % ^ (or **), parentheses, constants pi/e/tau and functions: sqrt, cbrt, abs, round(x, digits), floor, ceil, trunc, sign, ln, log(x[, base]), log10, log2, exp, pow, sin, cos, tan, asin, acos, atan, atan2, min, max, hypot, factorial. Trig uses radians. Example: "(1250 * 1.08^5) - 1250".

Input Schema

NameRequiredDescriptionDefault
decimalsNoOptional: round the result to this many decimal places
expressionYesThe expression to evaluate

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already cover safety (readOnly, idempotent, not destructive, closed-world), so the bar is low. The description adds real behavioral value beyond them: it discloses exact (non-floating-drift) evaluation and that trig operates in radians, both of which materially affect results. It stops short of describing output formatting or error behavior.

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?

Front-loaded with the core purpose and the benefit, then the syntax reference, then a concrete example. The long function enumeration is dense but earns its place as it defines the accepted input, which is essential to calling correctly.

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 two-parameter, no-output-schema tool, the description covers input grammar, precision behavior, and angular units thoroughly. The only gap is that the return type/shape (numeric vs. formatted string) is left implicit.

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%, so the decimals parameter is already documented. The description adds genuinely new semantics beyond the schema by enumerating the accepted grammar (operators, constants, full function list, radians convention) and giving a worked example, which the terse schema does not provide.

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 precise verb and resource: evaluating an arithmetic expression exactly. No sibling tool overlaps with general expression evaluation, so it is immediately distinguishable from convert_units, business_days, and the validators.

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

Usage Guidelines3/5

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

Implied usage is clear (compute a numeric expression), but there is no statement of when to prefer this over siblings like convert_units or date_diff for arithmetic that overlaps those domains, and no prerequisites or exclusions are given.

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