calculate
Evaluate a simple arithmetic expression using operators +, -, *, /, (, ), ., %. Returns the result as a string, preventing code injection by disallowing variables or functions.
Instructions
对一个简单的算术表达式求值。
仅允许数字、空白以及 + - * / ( ) . % 运算符,
禁止任何变量、函数或属性访问,以避免代码注入。
Args:
expression: 例如 "1 + 2 * (3 - 4)"。
Returns: 表达式的字符串化结果。
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 |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |