Calculator: evaluate a math expression exactly
util_calcEvaluate a math expression and get the exact number back, so the agent does not do arithmetic in its head. Supports + - * / % ^ (or **), parentheses, implicit multiplication (2pi), factorial (5!), constants pi, e, tau, phi, and functions sqrt, cbrt, abs, exp, ln, log (base 10), log2, sin/cos/tan (radians) and inverses, floor, ceil, round, min, max, pow, hypot. Optional named variables. Safe parser (no code execution); errors such as division by zero return 400 (not charged). Price: $0.001 per call (USDC on Base via x402); the first 10 calls per day are 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": "util_calc"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| vars | No | Optional variables, e.g. x=2,rate=0.05 | |
| precision | No | Decimal places to round to, 0–15 (default 12) | |
| expression | Yes | Math expression, e.g. (1250*0.075)+sqrt(144)/3 |