Skip to main content
Glama
kelseyee

Calculator MCP

by kelseyee

subtract

Calculate the difference between two numbers by subtracting one from another. Use this tool to perform floating-point subtraction operations for mathematical calculations.

Instructions

执行浮点数减法运算

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aYes
bYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function for the 'subtract' MCP tool. It is registered via the @mcp.tool() decorator and implements subtraction of two float numbers.
    @mcp.tool()
    def subtract(a: float, b: float) -> float:
        """执行浮点数减法运算"""
        return a - b
Behavior2/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 states the tool performs floating-point subtraction, which implies a mathematical operation, but doesn't disclose behavioral traits like error handling (e.g., for non-numeric inputs), precision limits, or whether it's read-only or has side effects. The description is minimal and lacks context on how the tool behaves beyond the basic operation.

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?

The description is a single, efficient sentence '执行浮点数减法运算' that directly states the tool's purpose. It's appropriately sized for a simple arithmetic tool and front-loaded with the core functionality. There's no wasted text, though it could be slightly more informative without losing conciseness.

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?

Given the tool's low complexity (simple subtraction), two parameters with clear schema, and an output schema (implied by 'Has output schema: true'), the description is minimally adequate. However, it lacks details on usage context, error handling, or how it fits with siblings, which would improve completeness. For a basic tool, it meets the minimum but doesn't provide rich contextual information.

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

Parameters3/5

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

The description adds minimal meaning beyond the input schema. It specifies 'floating-point' subtraction, which implies parameters 'a' and 'b' should be numbers, but the schema already defines them as type 'number'. With 0% schema description coverage, the description doesn't compensate by explaining parameter roles (e.g., minuend and subtrahend) or constraints. Baseline 3 is appropriate as the schema does the heavy lifting with clear property definitions.

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

Purpose4/5

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

The description '执行浮点数减法运算' clearly states the tool performs floating-point subtraction, which is a specific verb+resource combination. It distinguishes from siblings like 'add' and 'multiply' by specifying subtraction rather than other arithmetic operations. However, it doesn't explicitly mention the tool name 'subtract' in the description, keeping it at 4 rather than 5.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'add' or 'divide', nor does it specify scenarios where subtraction is preferred over other operations. There's no context about input types or constraints beyond 'floating-point', which is implied but not explicitly contrasted with other tools.

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/kelseyee/mcp_calculator'

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