Skip to main content
Glama

Calculate

calculate

Arithmetic, scientific functions, percentages, and unit conversion. No network and no eval. expression is at most 500 characters. precision is 1 to 34 significant digits, default 15. An unknown symbol returns the supported unit list.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "expression": "<expression>"
    },
    "name": "calculate"
  }
}

Input Schema

NameRequiredDescriptionDefault
precisionNoSignificant digits from 1 to 34. Default 15.
expressionYesMath expression or '<number> <unit> to <unit>'. At most 500 characters.

Output Schema

NameRequiredDescriptionDefault
okNo
unitNo
errorNo
resultNo
warningsNo
result_numberNo
supported_unitsNo
normalized_expressionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses the sandbox posture ('No network and no eval'), the 500-character input ceiling, the precision range and default, and even the failure mode for unrecognized units. It stops short of covering any rate limits or whether expressions are evaluated in a stateless way, but the safety-relevant traits are present.

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?

Four short sentences, capability first, then constraints, then error behavior, with no filler. Each clause carries distinct information an agent needs.

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 simple two-parameter tool with an output schema present and annotations absent, the description covers scope, limits, defaults, and the unit-error path, which is nearly everything needed. The only gap is the lack of sibling routing guidance, which matters more here given several numeric siblings.

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%, so both parameters are already fully documented in structured form, making 3 the baseline. The description does not add syntax detail beyond the schema; the only extra meaning, the unit-list error response, is about failure behavior rather than parameters.

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 names the concrete capability set (arithmetic, scientific functions, percentages, unit conversion) so the agent knows exactly what class of computation this handles. It does not, however, distinguish itself from nearby siblings such as date_math or time_convert, which also perform numeric work.

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

Usage Guidelines3/5

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

Usage is only implied by the enumerated capability list; there is no explicit statement of when to prefer this over date_math or time_convert. An agent can reasonably infer 'use for math and unit conversion,' but the routing decision is left 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.

Resources