calculate_expression
Safely evaluate math expressions with operators, parentheses, factorials, trig, logs, and roots, choosing degree or radian angles.
Instructions
Evaluate a maths expression safely, e.g. "2*sin(30) + sqrt(16) + 5!".
Args: expression: Supports + - * / // % ^ **, parentheses, !, pi, e, tau and sqrt, cbrt, root, exp, log, ln, sin, cos, tan, asin, acos, atan, factorial, abs, power, percent, mod. angle_unit: "deg" (default) or "rad" for trigonometric functions.
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_expression"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| angle_unit | No | deg | |
| expression | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |