calculator
Safely evaluate mathematical expressions with arithmetic, powers, parentheses, and functions like sqrt, sin, log. Includes constants pi and e.
Instructions
Evaluate a mathematical expression safely. Supports +, -, *, /, %, ^ (power), parentheses, and functions: sqrt, abs, sin, cos, tan, asin, acos, atan, log (base 10), ln (natural), exp, floor, ceil, round. Constants: pi, e. Example: 'sqrt(16) + 2^3' = 12
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 to evaluate, e.g. '2 + 3 * 4' or 'sqrt(144) + pi' |