calculator
Evaluate mathematical and scientific expressions safely with an isolated AST evaluator to obtain exact numeric results and prevent arithmetic errors.
Instructions
Safely evaluate mathematical and scientific expressions using an isolated AST evaluator without unsafe execution. Supports arithmetic (+, -, *, /, **), trigonometry (sin, cos, tan), logarithms, square roots, and factorials. Use whenever exact numeric precision is required to avoid arithmetic hallucinations. Pure, deterministic, and idempotent.
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": "calculator"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| expression | Yes | The mathematical expression string to evaluate (e.g. 'sqrt(144) + 15 * log(100)'). |