Skip to main content
Glama

Mathematical Calculator

calc_expression
Read-onlyIdempotent

Safely evaluate mathematical expressions with support for basic operations and math functions.

Supported operations: +, -, *, /, **, () Supported functions: sin, cos, tan, log, sqrt, abs, pow

Input Schema

NameRequiredDescriptionDefault
expressionYesMathematical expression to evaluate. Supports +, -, *, /, **, and math functions (sin, cos, sqrt, log, etc.). Example: '2 * sin(pi/4) + sqrt(16)'

Output Schema

NameRequiredDescriptionDefault
topicYes
resultYes
difficultyYes
expressionYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint and idempotentHint, so safety is partly covered, but the description still adds meaningful behavioral context: the word "Safely" signals sandboxed evaluation, and the explicit whitelist of allowed operators and functions tells the agent which expressions will succeed. It stops short of describing error behavior for invalid or out-of-scope expressions.

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?

The purpose sentence is front-loaded and the two short capability lists scan quickly. There is mild duplication with the schema's own parameter description, which also enumerates the supported operators and functions, but overall the text is tight and earns its length.

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, read-only, idempotent tool with a fully described schema and an output schema that covers return values, the description supplies everything needed to invoke it correctly. The only gap is what happens on an unsupported or malformed expression, which is a minor omission.

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 description coverage is 100% and the single expression parameter is already well documented there, including an example and the 500-char limit. The description's operator/function list marginally reinforces the schema but adds no syntax or formatting detail beyond it, so the baseline of 3 applies.

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?

The description gives a clear verb+resource ("evaluate mathematical expressions") plus the supported operator/function surface, so an agent immediately knows this is a general-purpose expression evaluator. It does not, however, explicitly distinguish itself from siblings like calc_interest or calc_statistics, which also perform calculation, so the boundary is only implied.

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?

There is no when-to-use or when-not-to-use guidance and no sibling is named. An agent cannot tell from the text whether this should handle an interest or statistics question that happens to be expressible as a formula, leaving the routing decision to inference.

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.