Skip to main content
Glama

ScorpTech x402 Tools

Math Eval

math_eval
Read-onlyIdempotent

Evaluate math expressions safely and exactly — the calculator agents should call instead of doing arithmetic in their heads. Exact rational arithmetic by default (0.1 + 0.2 = 3/10, 1/3 + 1/6 = 1/2, 2^200 and 1000! in full), with repeating-decimal notation, plus floating point for transcendental functions: sqrt, cbrt, root, exp, ln, log (base 10, or log(x, b)), log2, trig and hyperbolic functions (radians or degrees), gamma, erf, factorial, nCr / nPr, gcd / lcm, mod, min / max / sum / mean / median, round(x, digits), comparisons. Implicit multiplication (2pi, 3(x+1)), variables, and multi-statement scripts ("r = 2; pi r^2"). No code execution. Price: $0.001 USDC per successful call (x402, Solana). Same tool over HTTPS: GET https://scorptech.it.com/api/x402/v1/math-eval

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": {
      "expr": "<expr>"
    },
    "name": "math_eval"
  }
}

Input Schema

NameRequiredDescriptionDefault
exprYesExpression, or statements separated by ";" (assign with name = expr; the last value is returned)
modeNoauto: exact rationals whenever possible; float: IEEE double throughoutauto
varsNoVariables, e.g. "x=2, rate=0.05" or a JSON object
angleNorad
digitsNoDecimal places in the "decimal" string

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, yet the description still adds substantive behavior: exact rational arithmetic by default, float mode for transcendentals, 'No code execution' (a real safety guarantee), and a concrete cost model ($0.001 USDC per successful call via x402 on Solana) plus an HTTPS fallback endpoint. Payment and safety constraints are exactly the kind of context annotations cannot express.

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?

The core claim and the 'no mental arithmetic' routing are front-loaded, followed by grouped capability and pricing sentences. The dense middle run-on listing dozens of functions is long but functional for capability discovery; it could be trimmed without loss.

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 5-parameter tool with no output schema, the description covers input syntax, exact-vs-float semantics, angle units, and pricing. It only partially compensates for the missing output schema by showing example result forms (3/10, 1/2, full 2^200) rather than describing the actual response shape.

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 already 80%, and the description goes further with expr syntax examples ('r = 2; pi r^2'), implicit multiplication, variable usage, degree/radian handling, and repeating-decimal output. The 'digits' parameter's effect on the returned decimal string is not clarified beyond the schema, keeping this short of a 5.

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 and resource ('Evaluate math expressions') and immediately positions itself as the general-purpose calculator, which separates it from the hundreds of narrow number-theory siblings (poly_eval, equation_solve, compound_interest). An agent can tell what this is and why it exists 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?

Gives an explicit trigger ('the calculator agents should call instead of doing arithmetic in their heads') and the long capability list tells the agent which operations are in scope. It never states when NOT to use it or names a sibling alternative for specialized cases (e.g. poly_eval for polynomials), so routing versus siblings 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