Skip to main content
Glama

calculator.calculate

Evaluates arithmetic expressions (e.g., addition, subtraction, multiplication, division, modulo, exponentiation). Provide an expression like '(12.5 + 7.5) * 2' to get the numeric result.

Instructions

计算一个基础算术表达式。当用户询问加减乘除、取模或乘方结果时调用。expression 示例:(12.5 + 7.5) * 2。仅计算,不执行代码。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
expressionYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It discloses a key safety behavior: '仅计算,不执行代码' (only calculate, not execute code), which is critical for a tool that takes an expression string. However, it does not mention edge cases like division by zero or error handling, though the output schema likely covers return format. This is good but not exhaustive.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is three concise sentences, each serving a distinct purpose: statement of function, usage trigger, and an example plus safety note. It is front-loaded with the core action and contains no fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the simplicity of the tool (one parameter, output schema present, unrelated sibling), the description is complete. It covers purpose, usage, parameter format with an example, and a critical behavioral limitation. There is no missing information that would prevent a correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0% description coverage, so the description must compensate fully. It does so by providing an example of the expression parameter: '(12.5 + 7.5) * 2', and listing supported operators. This gives the agent a clear format and scope for the parameter, going beyond the schema's bare type definition.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: '计算一个基础算术表达式' (calculate a basic arithmetic expression), with specific operations listed (加减乘除, 取模, 乘方). It also provides a concrete example. The sibling tool time.get_current is completely unrelated, so differentiation is clear.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly states when to use the tool: '当用户询问加减乘除、取模或乘方结果时调用' (call when the user asks for results of addition, subtraction, multiplication, division, modulo, or exponentiation). It also gives a when-not: '仅计算,不执行代码' (only calculate, do not execute code), clarifying it should not be used for code execution.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Sen0E/MiaoMcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server