Skip to main content
Glama

Run a calculator

run_calculator
Read-onlyIdempotent

Use this when the user needs one of Calcgrid's 737 deterministic calculators and no dedicated typed tool covers it. Call it immediately after search_calculators once calculator_id and input_hints are known; do not stop at search or schema discovery. Do not use it for trivial arithmetic, live rates or unrelated tasks. Returns typed values with units, formula, sources, freshness and timestamp; validation errors identify the field and a repair hint.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputsYesParameter names and values from search_calculators input_hints or get_calculator_schema. Use numbers as numbers, ISO dates as YYYY-MM-DD and lists as arrays.
calculator_idYesExact calculator_id from search_calculators; for example 'compound-interest'.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
linksNo
resultYes
requestYes
sourcesNo
successYes
versionNo
freshnessNo
timestampYes
next_actionsNo
service_versionYesDeployed Calcgrid implementation version used for the result.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedOutput schema / properties / service_version
      Added value: +{
      +  "description": "Deployed Calcgrid implementation version used for the result.",
      +  "type": "string"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "success",
      -  "request",
      -  "result",
      -  "timestamp"
      -]New value: +[
      +  "success",
      +  "service_version",
      +  "request",
      +  "result",
      +  "timestamp"
      +]
  2. Changed19 schema fields changed
    • changedInput schema / properties / calculator_id / description
      Previous value: -"Calculator id, e.g. 'compound-interest'."New value: +"Exact calculator_id from search_calculators; for example 'compound-interest'."
    • addedInput schema / properties / calculator_id / examples
      Added value: +[
      +  "compound-interest"
      +]
    • changedInput schema / properties / inputs / description
      Previous value: -"Input parameters keyed by name as documented by get_calculator_schema."New value: +"Parameter names and values from search_calculators input_hints or get_calculator_schema. Use numbers as numbers, ISO dates as YYYY-MM-DD and lists as arrays."
    • addedInput schema / properties / inputs / examples
      Added value: +[
      +  {
      +    "annual_rate_percent": 4.8,
      +    "principal": 15000,
      +    "years": 12
      +  }
      +]
    • changedOutput schema / description
      Previous value: -"Unified result envelope (see /docs/response-format.md)"New value: +"Deterministic calculation result with typed values, units, formula, sources and timestamp."
    • addedOutput schema / properties / next_actions / items
      Added value: +{
      +  "type": "object"
      +}
    • addedOutput schema / properties / request / properties
      Added value: +{
      +  "calculator_id": {
      +    "type": "string"
      +  },
      +  "inputs": {
      +    "type": "object"
      +  },
      +  "tool": {
      +    "type": "string"
      +  }
      +}
    • addedOutput schema / properties / result / properties / calculator_id
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / result / properties / calculator_name
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / result / properties / entity_type
      Added value: +{
      +  "const": "calculation",
      +  "type": "string"
      +}
    • addedOutput schema / properties / result / properties / status
      Added value: +{
      +  "const": "completed",
      +  "type": "string"
      +}
    • addedOutput schema / properties / result / properties / units / additionalProperties
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / result / properties / values / additionalProperties
      Added value: +true
    • addedOutput schema / properties / result / required
      Added value: +[
      +  "entity_type",
      +  "calculator_id",
      +  "status",
      +  "values",
      +  "formula",
      +  "summary"
      +]
    • addedOutput schema / properties / sources / items
      Added value: +{
      +  "type": "object"
      +}
    • addedOutput schema / properties / success / const
      Added value: +true
    • addedOutput schema / properties / timestamp / format
      Added value: +"date-time"
    • addedOutput schema / properties / version
      Added value: +{
      +  "type": "string"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "success"
      -]New value: +[
      +  "success",
      +  "request",
      +  "result",
      +  "timestamp"
      +]
  3. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false and openWorldHint=false, so the safety profile is covered. The description still adds real behavioral value beyond that: deterministic (not live) results, typed values with units/formula/sources/freshness/timestamp, and that validation errors name the offending field plus a repair hint. It does not cover latency or limits, keeping it out of the 5 tier.

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?

Front-loads the trigger condition, then the workflow, then exclusions, then return/error behavior – a sensible priority order. Slightly dense with four distinct ideas packed in, but virtually every clause carries operational information and none is filler.

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 a rich annotation set, an output schema and 100% schema description coverage, the description supplies the only things structured fields cannot: the routing rule against 200+ typed siblings, the search-then-run sequencing, and the error-repair contract. Nothing an agent needs to invoke it correctly is missing.

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 coverage is 100% for both required parameters, including an example object and format rules for dates/numbers/lists, so the baseline is 3. The description's reference to calculator_id and input_hints largely restates what the schema's own descriptions already say, adding little new parameter meaning.

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?

States a specific verb (run) and resource (one of Calcgrid's 737 deterministic calculators) and explicitly carves out the fallback role: 'no dedicated typed tool covers it.' That distinguishes it from the many typed siblings (calculate_bmi, calculate_loan_payment, etc.) without the agent needing to open a schema.

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?

Gives an explicit trigger ('needs one of Calcgrid's 737 deterministic calculators'), an explicit workflow ordering ('call immediately after search_calculators ... do not stop at search or schema discovery'), and explicit exclusions ('trivial arithmetic, live rates or unrelated tasks'). This is textbook when/when-not/alternatives guidance.

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