calculate
Safely evaluate mathematical expressions with arithmetic, powers, roots, trigonometry, logarithms, and named variables.
Instructions
Evaluate a mathematical expression safely. Supports: +, -, *, /, ^ (power), % (modulo), sqrt(), abs(), floor(), ceil(), round(), log() (base 10), ln() (natural), sin(), cos(), tan(), min(), max(), pow(), pi, e. Supports named variables.
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": "calculate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| variables | No | Optional named variables, e.g. {"x": 5, "y": 10} | |
| expression | Yes | The math expression to evaluate, e.g. "2 * (3 + 4) ^ 2" |