Skip to main content
Glama
SanLangLOVE

Simple Calculator MCP

by SanLangLOVE

add

Calculate the sum of two numbers using this basic mathematical operation tool. Input two numerical values to get their total.

Instructions

计算两个数字的和

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aYes第一个数字
bYes第二个数字

Implementation Reference

  • The handler for the "add" tool that extracts arguments a and b, computes their sum, and returns a text response with the calculation result.
    case "add": {
      const { a, b } = args as { a: number; b: number };
      const result = a + b;
      return {
        content: [
          {
            type: "text",
            text: `${a} + ${b} = ${result}`,
          },
        ],
      };
    }
  • Defines the input schema for the "add" tool, specifying an object with required number properties 'a' and 'b'.
    inputSchema: {
      type: "object",
      properties: {
        a: {
          type: "number",
          description: "第一个数字",
        },
        b: {
          type: "number",
          description: "第二个数字",
        },
      },
      required: ["a", "b"],
    },
  • src/index.ts:18-35 (registration)
    Registers the "add" tool in the tools array, including name, description, and input schema, which is returned in response to ListTools requests.
    {
      name: "add",
      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. The description only states what the tool does mathematically, but doesn't mention any behavioral traits like error handling (e.g., overflow), performance characteristics, or whether it's idempotent. For a tool with zero annotation coverage, this is a significant gap.

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 with zero wasted words. It's appropriately sized for this simple arithmetic tool and front-loads the essential information.

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?

For a simple arithmetic tool with 100% schema coverage and no output schema, the description is minimally adequate. It explains what the tool does but doesn't provide information about return values, error conditions, or behavioral context that would be helpful for an AI agent. The lack of annotations means the description should do more to compensate.

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 schema description coverage is 100%, with both parameters 'a' and 'b' clearly documented as '第一个数字' (first number) and '第二个数字' (second number). The description adds no additional parameter information beyond what the schema already provides, so the baseline score of 3 is appropriate.

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 '计算两个数字的和' (calculates the sum of two numbers) clearly states the specific verb ('计算' - calculate) and resource ('两个数字的和' - sum of two numbers). It precisely distinguishes this tool from its siblings (divide, multiply, power, subtract) by specifying the exact arithmetic 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. While the purpose is clear, there's no mention of when addition is appropriate compared to other arithmetic operations like subtraction or multiplication, nor any context about prerequisites or constraints.

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