Skip to main content
Glama

Calculate

calculate
Read-only

Evaluate a safe arithmetic expression and return the numeric result. Supports +,-,*,/,**,%,sqrt,abs,round,floor,ceil,log,sin,cos,tan,pi,e. Use for derived figures (ratios, differences, percentages) that no tool output already provides.

Use when: Use when an agent must derive a value that tool outputs do not already include, such as a ratio, spread, or percentage. Do not use to re-derive pre-computed fields like std_30d or dca_baseline_90d that get_token_price_historical returns.

Limitations: Arithmetic only — no aggregation over tool history, no unit conversion, and no financial modeling beyond the listed functions. Errors return an error field rather than raising.

Alternatives: get_token_price_historical, get_datetime

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
expressionYesA safe arithmetic expression, e.g. '(3 + 4) * 2 / sqrt(9)'

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorNo
resultNo
expressionYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / expression / title
      Added value: +"Expression"
    • addedInput schema / title
      Added value: +"mcp_calculateArguments"
  2. First observed

TDQS

A4.7/5.0
Behavior4/5

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

Annotations declare readOnlyHint=true, and the description adds meaningful behavioral context beyond that: it is arithmetic-only, has no aggregation/unit conversion/financial modeling, and errors return an error field rather than raising. This gives the agent a clear model of what the tool will and won't do. It doesn't describe every edge case, but it covers the important behavioral boundaries.

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 clear sections: a one-sentence purpose, a 'Use when' section, a 'Limitations' section, and an 'Alternatives' section. Every sentence earns its place, and the most important information is front-loaded. It is appropriately sized for the tool's complexity.

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?

Given the tool's simplicity (one parameter, read-only, arithmetic-only), the description is complete. It covers purpose, usage, limitations, alternatives, and error behavior. The output schema exists, so the description doesn't need to explain return values. An agent has everything it needs to decide when to call this tool and how to construct a valid expression.

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 description coverage is 100%, so the schema already documents the single 'expression' parameter. The description adds value by listing supported operators/functions and giving an example expression format, which helps the agent construct valid input. It doesn't need to do much more because there is only one parameter and the schema covers it.

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 states a specific verb ('Evaluate'), a resource ('a safe arithmetic expression'), and the outcome ('return the numeric result'). It also lists supported operators/functions and explicitly distinguishes itself from sibling tools by saying it is for derived figures that no tool output already provides. This is a clear, specific purpose that an agent can act on.

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

Usage Guidelines5/5

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

The description gives explicit 'Use when' guidance, tells the agent when NOT to use it (do not re-derive pre-computed fields like std_30d or dca_baseline_90d), and names alternatives (get_token_price_historical, get_datetime). This is exactly the kind of when/when-not/alternatives guidance that helps an agent select the right tool.

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