Skip to main content
Glama
zahrafatima9432

MCP Toolbox

calculate

Evaluate arithmetic expressions safely and return numeric results. Supports operators, parentheses, constants, and math functions like sqrt and log without using eval.

Instructions

Safely evaluate an arithmetic expression and return the numeric result.

Supports + - * / // % ** parentheses, the constants pi/e/tau, and common math functions (sqrt, sin, cos, log, factorial, etc.). It does NOT use eval; expressions are parsed and evaluated against a strict whitelist.

Args: expression: e.g. "2 + 2", "sqrt(144)", "(3.5 * 4) ** 2", "log(e)".

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
expressionYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It explicitly states safety guarantees: 'does NOT use eval', 'parsed and evaluated against a strict whitelist', and lists supported operators, constants, and functions. This goes far beyond a bare definition and adequately discloses behavior.

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 concise and well-structured: purpose in the first sentence, then capabilities and safety note, then parameter examples. Every sentence adds value, and the most important information is front-loaded.

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 single-parameter tool with no output schema, the description is nearly complete: it covers syntax, supported functions, constants, and safety. The only gap is error behavior (e.g., how invalid expressions are handled), which is a minor omission for a calculator tool but would help an agent anticipate failures.

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?

Schema coverage is 0%, so the description must compensate. It does so effectively by documenting the 'expression' parameter with concrete examples ('2 + 2', 'sqrt(144)', 'log(e)') and a list of supported syntax. This gives an agent far more semantic understanding than the bare schema field.

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 opens with a clear verb and resource: 'Safely evaluate an arithmetic expression and return the numeric result.' It explicitly states what the tool does and its scope, and it is easily distinguished from the document/search siblings. No ambiguity remains about purpose.

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 description clearly defines the domain of use (arithmetic expressions with a specific feature set), and the sibling tools are unrelated to calculation, so confusion is unlikely. However, it does not explicitly state when not to use the tool or mention any alternative, making the guidance contextually clear but not explicitly comparative.

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