calculate
Safely evaluate an arithmetic expression and return the exact result.
Supports +, -, *, /, //, %, ** (power), parentheses, the constants pi and e, and the functions sqrt(), abs(), round(). Does not execute arbitrary code.
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 | An arithmetic expression, e.g. "(3 + 4) * 2 ** 5" or "sqrt(2) * pi". |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||