Skip to main content
Glama

Calculator, statistics and unit converter

math_calc
Read-only

Evaluate math expressions, compute summary statistics from number lists, and convert units across length, mass, volume, area, speed, data, time, energy, and temperature.

Instructions

Exact math agents shouldn't guess: evaluate an expression (+ - * / % ^, sqrt, log, sin, pi...), summary statistics for a list of numbers (mean, median, std dev, percentiles, mode), or convert units (length, mass, volume, area, speed, data, time, energy, temperature). Costs $0.001 per call.

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": {
      "op": "<op>"
    },
    "name": "math_calc"
  }
}

Input Schema

NameRequiredDescriptionDefault
opYes"eval", "stats" or "convert".
toNoFor convert: unit, e.g. "km", "kg", "c", "gb".
fromNoFor convert: unit, e.g. "mi", "lb", "f", "gib".
valueNoFor convert: the amount.
numbersNoFor stats.
expressionNoFor eval, e.g. "(1200 * 1.08^5) / 12".

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations only declare readOnlyHint=true, so the description's job is to add context, and it does: the per-call cost of $0.001 is a genuinely useful behavioral fact not derivable from structured fields, and the list of supported functions/unit families bounds what will succeed. It stops short of disclosing output shape, numeric precision/rounding, or error behavior (division by zero, unsupported unit), which are the remaining transparency gaps.

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?

A single front-loaded sentence: the usage imperative first, then the three modes in schema order (eval, stats, convert), then the cost. No filler, and the parenthetical enumerations carry information rather than padding.

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 6-parameter, single-required-field tool with no output schema, the description covers all three modes and even enumerates the statistics returned (mean, median, std dev, percentiles, mode), which substitutes for an output schema on that branch. It leaves unstated the return shape for eval/convert and failure modes, a minor but real gap.

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 coverage is 100%, so the baseline is 3; the description earns a bump by documenting the accepted expression vocabulary (+, -, *, /, %, ^, sqrt, log, sin, pi) and the unit categories, which the schema does not state. It does not clarify interaction between op and the optional fields, but the added domain meaning is real.

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?

Names three concrete operations with specific verbs and resources: evaluate an expression, compute summary statistics over a number list, and convert units across nine named categories. The enumerated math functions (sqrt, log, sin, pi) and unit categories make it clearly distinguishable from siblings like currency_convert, data_convert, and date_calc without opening any schema.

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?

"Exact math agents shouldn't guess" gives a clear situational trigger (use this instead of estimating), which is real usage guidance. However, it offers no routing against the closest siblings — it never says to use currency_convert for money or data_convert for byte conversions, despite overlapping unit categories (data, temperature). Usage is implied rather than explicitly bounded.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.