Skip to main content
Glama

utility-converter

calculate

Safely evaluate an arithmetic expression and return the exact result.

Supports +, -, *, /, //, %, ** (power), parentheses, the constants pi and e, and the functions sqrt(), abs(), round(). Does not execute arbitrary code.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
expressionYesAn arithmetic expression, e.g. "(3 + 4) * 2 ** 5" or "sqrt(2) * pi".

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

No annotations provided, so description carries full burden. It explicitly states 'safely evaluate' and 'does not execute arbitrary code,' disclosing key behavioral traits (no side effects, restricted operations).

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?

Three concise sentences, front-loaded with main action. Every sentence adds value without redundancy.

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 output schema present, description need not explain return values. It sufficiently covers input format, supported operations, and safety, making it complete for this tool.

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% with parameter description. Description adds meaning by detailing supported operations and functions beyond the schema's brief example.

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?

Description clearly states it evaluates arithmetic expressions and returns exact result, listing supported operators, constants, and functions. This distinguishes it from sibling tools like calculate_date and convert_units.

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?

Implicitly guides usage by specifying safe evaluation and lack of code execution. No explicit when-to-use or when-not-to-use, but context from siblings suffices.

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.