Math Eval
math_evalEvaluate 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
| Name | Required | Description | Default |
|---|---|---|---|
| expr | Yes | Expression, or statements separated by ";" (assign with name = expr; the last value is returned) | |
| mode | No | auto: exact rationals whenever possible; float: IEEE double throughout | auto |
| vars | No | Variables, e.g. "x=2, rate=0.05" or a JSON object | |
| angle | No | rad | |
| digits | No | Decimal places in the "decimal" string |