Skip to main content
Glama
SanLangLOVE

Simple Calculator MCP

by SanLangLOVE

subtract

Calculate the difference between two numbers by subtracting one from another using this mathematical operation tool.

Instructions

计算两个数字的差

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aYes被减数
bYes减数

Implementation Reference

  • Handler for the 'subtract' tool: extracts arguments a and b, computes their difference, and returns a formatted text response.
    case "subtract": {
      const { a, b } = args as { a: number; b: number };
      const result = a - b;
      return {
        content: [
          {
            type: "text",
            text: `${a} - ${b} = ${result}`,
          },
        ],
      };
    }
  • Schema definition for the 'subtract' tool, including name, description, and input schema requiring two number parameters: a (minuend) and b (subtrahend).
    {
      name: "subtract",
      description: "计算两个数字的差",
      inputSchema: {
        type: "object",
        properties: {
          a: {
            type: "number",
            description: "被减数",
          },
          b: {
            type: "number",
            description: "减数",
          },
        },
        required: ["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 of behavioral disclosure. It only states the calculation function without mentioning any behavioral traits such as error handling (e.g., for non-numeric inputs), performance characteristics, or side effects. For a tool with zero annotation coverage, this is a significant gap in transparency.

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 a single, efficient sentence ('计算两个数字的差') that directly states the tool's purpose without any wasted words. It is appropriately sized for a simple arithmetic tool and front-loaded with the core functionality, making it easy to understand at a glance.

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 with two parameters) and high schema coverage (100%), the description is somewhat complete but lacks depth. It doesn't explain the return value (no output schema exists) or potential errors, which could be helpful. However, for such a basic operation, the description is minimally adequate.

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 does not add meaning beyond what the input schema provides. The schema has 100% coverage with clear descriptions for parameters 'a' (被减数 - minuend) and 'b' (减数 - subtrahend), which already define their roles in subtraction. Since schema coverage is high, the baseline score of 3 is appropriate, as the description doesn't compensate but also doesn't detract.

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 '计算两个数字的差' (calculates the difference between two numbers) clearly states the tool's purpose with a specific verb ('计算' - calculate) and resource ('两个数字的差' - difference of two numbers). It distinguishes from siblings like 'add' or 'multiply' by specifying subtraction, though it doesn't explicitly contrast them. The purpose is unambiguous but could be slightly more explicit about the mathematical operation.

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 like 'add' or 'divide'. It states what the tool does but offers no context about appropriate scenarios, prerequisites, or comparisons to sibling tools. Users must infer usage from the tool name and description alone.

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/SanLangLOVE/mcp-calculator'

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