Calculate
calculateEvaluate arithmetic expressions safely without executing code, including basic operators, comparisons, constants, and common math/statistics functions.
Instructions
Evaluate an arithmetic expression safely (no 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 | Arithmetic expression, e.g. '(3.5 + 2) * 4', 'sqrt(2) / 2', 'mean([0.71, 0.64, 0.8])'. Supports + - * / // % **, comparisons, pi/e/tau and common math and statistics functions. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes | ||
| expression | Yes |