evaluate
Compute the numeric value of a mathematical expression safely in a sandbox. Supports operators, constants, and functions like sqrt, sin, log, and factorial.
Instructions
Evaluate a mathematical expression and return its numeric value.
Supports + - * / // % **, parentheses, the constants pi, e,
tau and functions such as sqrt, sin, cos, log,
exp, factorial, gcd, hypot. Evaluation is sandboxed: no
Python eval is used and only whitelisted names are allowed.
Example: "sqrt(2) * sin(pi / 4)" -> 1.0.
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": "evaluate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| expression | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |