Skip to main content
Glama

Agent Data Tools: Full list (every tool as its own definition)

Math expression calculator: evaluate a formula safely

math_evaluate
Read-only

Evaluate an arithmetic expression safely (parsed, never executed as code): + - * / % ^ and **, parentheses, factorial !, constants pi, e and tau, and functions sqrt, cbrt, abs, round, floor, ceil, exp, ln, log (base 10), log2, sin, cos, tan, asin, acos, atan (radians), min, max and pow. Up to 500 characters. Use when an agent needs exact arithmetic instead of guessing, for prices, unit maths or formulas. Example: expression=(1500 * 0.045 / 12) + sqrt(144) - 2^3. Price $0.01/call via x402 USDC or a card key (/credits), first 25 free; failed calls free. Reads or computes only and changes nothing; each call is charged, so repeats are not free.

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": "math_evaluate"
  }
}

Input Schema

NameRequiredDescriptionDefault
expressionYesThe expression, such as (2+3)*4^2/sqrt(16)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Adds substantially beyond the annotations: the expression is 'parsed, never executed as code', input is capped at 500 characters, failures are free, and each successful call is billed, which explains why idempotentHint=false matters. The cost/repeat-charging note is exactly the kind of context annotations cannot convey.

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-loaded lead sentence followed by grammar, then usage, example and pricing — a sensible order. The function enumeration is long but each item defines accepted input, so it largely earns its place; the pricing/safety sentences are slightly dense for the space.

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 one-parameter tool, the description covers syntax, length limits, use cases, example, and billing. The remaining gap is the return format (numeric type, precision, error shape), which matters because there is no output schema to fall back on.

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% and there is a single parameter, so the baseline is a 3; the description earns an extra point by documenting the allowed grammar (operators, `^`/`**`, `!`, constants, 20+ functions, radians for trig) and the 500-character limit, none of which the terse schema example conveys.

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?

Opens with a specific verb+resource ('Evaluate an arithmetic expression safely') and immediately disambiguates by naming the supported grammar (operators, factorial, constants, function list) plus a concrete example. An agent can tell this apart from math_stats or calc_* siblings without opening the schema.

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?

'Use when an agent needs exact arithmetic instead of guessing, for prices, unit maths or formulas' gives clear positive context for selection. It stops short of naming exclusions or pointing to alternatives (e.g. math_stats for aggregate work), so the when-not half is missing.

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.