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

Note: Use this tool to evaluate a single mathematical expression. To compute descriptive statistics over a list of numbers, use the statistics tool instead.

Examples:

  • "2 + 3 * 4" → 14

  • "sqrt(16)" → 4.0

  • "sin(3.14159/2)" → 1.0

Input Schema

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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
topicYes
resultYes
difficultyYes
expressionYes

TDQS

A4.2/5.0
Behavior3/5

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

The annotations already declare readOnlyHint and idempotentHint, so the safe/non-mutating behavior is already communicated. The description adds some behavioral context by listing supported functions and noting 'safely evaluate', but it does not disclose potential edge cases like domain restrictions (e.g., log of negative numbers) or error handling. Given the annotations, the description adds modest value beyond them, so a 3 is appropriate.

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 well-structured with a brief intro, a bulleted list of supported operations/functions, a clear usage note, and examples. Every sentence serves a purpose, and the information is front-loaded. It is concise while remaining informative, with no redundant or filler content.

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?

Given that an output schema exists (so return values are already documented), the description covers the essential aspects: what expressions to provide, supported operations/functions, and an example. It also contextualizes when to use an alternative tool. However, it does not mention constants like pi or limits on expression length, but the maxLength is in the schema. Overall, it is fairly complete for a calculator tool of moderate complexity.

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?

The input schema has full coverage of the single parameter 'expression', and the description goes beyond the schema by explicitly listing supported operations and functions, plus providing three concrete examples. This adds meaningful guidance on how to format the expression, which is not fully present in the schema. The examples help clarify expected input syntax.

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 clearly states the tool's purpose: 'Safely evaluate mathematical expressions' with a specific list of operations and functions. It also distinguishes itself from the statistics tool, which is a sibling, by explicitly noting that statistics should use a different tool. The verb 'evaluate' and resource 'mathematical expressions' are specific and unambiguous.

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 explicitly says 'Use this tool to evaluate a single mathematical expression' and provides a clear alternative for statistics ('use the statistics tool instead'). While it does not explicitly exclude other sibling tools like financial calc or unit conversion, the 'single mathematical expression' scope gives clear context for when to use this tool. This is clear usage guidance with one explicit exclusion.

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.

TDQS

A4/5.0
Disambiguation4/5

Most tools are clearly distinct (calculation, interest, stats, units, matrix ops, plotting, workspace). However, plot_function, plot_line_chart, and plot_financial_line could be confused since they all produce line-like plots, though descriptions note their specific use cases.

Naming Consistency5/5

Tool names follow a clear, consistent prefix pattern: calc_*, matrix_*, plot_*, and workspace_*. This makes it easy to infer related functionality at a glance.

Tool Count4/5

17 tools is on the higher side but acceptable for the wide math scope (basic arithmetic, statistics, units, matrices, plotting, workspace). Each tool serves a distinct purpose, though a couple like plot_line_chart and plot_function could potentially be consolidated.

Completeness4/5

Core mathematical operations are well covered: expression evaluation, statistics, unit conversion, matrix operations, and common plot types. Minor gaps exist (e.g., no bar chart, no equation solving), but these are not critical for the server's apparent educational purpose.