Mathematical Calculator
calc_expressionEvaluate a single mathematical expression safely using arithmetic operators and functions like sin, sqrt, and log.
Instructions
Safely evaluate mathematical expressions with support for basic operations and math functions.
Supported operations: +, -, *, /, **, () Supported functions: sin, cos, tan, log, sqrt, abs, pow
Note: Use this tool to evaluate a single mathematical expression. To compute descriptive statistics over a list of numbers, use the statistics tool instead.
Examples:
"2 + 3 * 4" → 14
"sqrt(16)" → 4.0
"sin(3.14159/2)" → 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": "calc_expression"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| expression | Yes | Mathematical expression to evaluate. Supports +, -, *, /, **, and math functions (sin, cos, sqrt, log, etc.). Example: '2 * sin(pi/4) + sqrt(16)' |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| topic | Yes | ||
| result | Yes | ||
| difficulty | Yes | ||
| expression | Yes |