Calculate
calculateSafely evaluate arithmetic expressions with +, -, *, /, //, %, **, and parentheses using an AST, without arbitrary code execution.
Instructions
Evaluate an arithmetic expression safely using abstract syntax tree (AST). Supports +, -, *, /, //, %, ** and parentheses. No arbitrary code execution.
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 |
|---|---|---|---|
| expression | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||