calculate
Evaluate arithmetic expressions and get exact results, avoiding floating-point errors and unsafe eval.
Instructions
Evaluate an arithmetic expression and return the result.
Args:
expression: The expression to evaluate, for example "2 + 3 * (4 - 1)",
"sqrt(16) + sin(pi/2)" or "123456789 * 987654321". `^` is accepted
as a power operator; `×` and `·` as multiply, `÷` as divide, and
`−` (U+2212) as minus.
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 |
|---|---|---|---|
| result | Yes |