calculator
Evaluate mathematical or statistical expressions safely using Python syntax. Supports arithmetic, list operations, and math functions with custom variables.
Instructions
Safely evaluates a mathematical or statistical expression string using Python syntax.
Supports arithmetic operations (+, -, *, /, **, %, //), list expressions, and a range of math and statistics functions:
abs, round, min, max, len, sum, mean, median, stdev, variance, sin, cos, tan, sqrt, log, exp, floor, ceil, etc.
Custom variables can be passed via the 'variables' dict, including lists for time series data.
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>",
"variables": "<variables>"
},
"name": "calculator"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| variables | Yes | ||
| expression | Yes |