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. Returns JSON with: expression, result, mode, exact, isInteger, variables. Price: $0.001 USDC per successful call (x402, Base or 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.6/5.0
Behavior5/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive), and the description layers on genuinely new behavior: no code execution, exact-vs-IEEE arithmetic outcomes, repeating-decimal notation, implicit multiplication, script semantics (last value returned), a per-call price with x402/Base/Solana payment, and an alternate HTTPS endpoint. That is context an agent cannot derive from the annotations.

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 with purpose in the first clause and structured as purpose, capability enumeration, behavior, return shape, then pricing/endpoint. The long parenthetical function catalog is dense but earns its place for capability discovery; it reads as a single run-on block rather than scannable sections.

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?

With no output schema, the description compensates by naming the returned JSON fields (expression, result, mode, exact, isInteger, variables). It also discloses cost and an alternate transport, leaving nothing material an agent needs before calling a 5-parameter, read-only computation tool.

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 80%, so the schema already documents expr, mode, vars, angle, and digits. The description still adds interpretive value by spelling out what exact mode produces (0.1+0.2 = 3/10), the repeating-decimal notation, radian-vs-degree behavior for trig, and the semicolon/assignment form of expr — meaning beyond the field text.

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 and resource ("Evaluate math expressions") and immediately frames the role: "the calculator agents should call instead of doing arithmetic in their heads." The scope (exact rational arithmetic, float transcendentals, variables, multi-statement scripts, no code execution) makes it unmistakable against numeric siblings like poly_eval.

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?

Clear usage context: call this rather than computing mentally, and the mode choice (auto exact vs float) is explained in terms of when each applies. It stops short of naming explicit alternatives or exclusions, but the "instead of" framing plus the mode/angle guidance gives an agent enough to select it confidently.

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