Skip to main content
Glama
mcp-math-calculator

mcp-math-calculator

by Cosmiumx

calculate

Evaluates mathematical expressions accurately, covering arithmetic, large numbers, scientific functions, and floating-point-safe results to prevent AI math errors.

Instructions

⚠️ 精确数学计算工具 - 请在任何涉及数字运算时使用

AI语言模型在数学计算上存在已知缺陷:

  • 大数计算错误率高

  • 浮点数精度问题(0.1+0.2≠0.3)

  • 复杂表达式容易出错

  • 即使简单运算也可能失误

为确保用户获得100%准确的结果,请在以下情况使用此工具: ✓ 任何数学表达式(包括简单的 1+1) ✓ 金融、科学、工程计算 ✓ 用户明确要求计算 ✓ 不确定自己能否算对时

支持的运算:

  • 基础运算: +, -, *, /, ^, %

  • 括号: ( )

  • 函数: sqrt, pow, abs, sin, cos, tan, log, exp 等

  • 常数: pi, e

输入格式:标准数学表达式 示例: "2+2", "(10+20)*3", "sqrt(16)", "sin(pi/2)", "0.1 + 0.2"

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

NameRequiredDescriptionDefault
precisionNo小数精度位数(可选,默认15位,范围1-64)
expressionYes要计算的数学表达式

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full behavioral burden. It discloses the accuracy motivation and the supported operator/function set, but never states what is returned (number vs. formatted string), how invalid expressions or division by zero are handled, or how the optional precision parameter rounds the output.

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

Conciseness4/5

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

Content is front-loaded with the warning and a checkmark trigger list, then supported operations, then format and examples, so an agent can stop reading early. It is somewhat long for a calculator and repeats the 'even simple arithmetic can fail' point twice, but no block is purely filler.

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

Completeness3/5

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

The tool is simple with two fully-described parameters, but there is no output schema, so the description should have said what comes back and what happens on invalid input or unsupported functions. As written, an agent knows how to call it but not what to expect in return or how to recover from errors.

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

Parameters4/5

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

Schema coverage is 100% and already documents both parameters, so the baseline is 3; the description goes beyond it by spelling out the accepted expression grammar (operators, parentheses, functions, constants) and giving four concrete example strings, which materially reduces malformed input. The `precision` parameter is left entirely to the schema.

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 names a concrete verb and scope: evaluates standard math expressions (+, -, *, /, ^, %, parentheses, sqrt/pow/sin/log etc., constants pi/e) with explicit input examples. An agent immediately knows this is an expression evaluator rather than, say, a unit converter or data query.

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

Usage Guidelines4/5

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

It gives an explicit trigger list ('any math expression including simple 1+1', financial/scientific/engineering calculations, user explicitly requests calculation, when unsure you can compute correctly). There is no when-not guidance and no named alternative, but with no siblings and a single obvious use case that omission is minor.

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

Deploy Server

Other Tools