Skip to main content
Glama
tech-sushant

Calculator MCP Server

by tech-sushant

add

Add two numbers together to calculate their sum. This tool performs basic addition for mathematical calculations.

Instructions

Add two numbers together

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aYesFirst number to add
bYesSecond number to add

Implementation Reference

  • Handler for the 'add' tool: destructures arguments a and b, computes their sum, and returns a text response with the result.
    case "add": {
      const { a, b } = args as { a: number; b: number };
      const result = a + b;
      return {
        content: [
          {
            type: "text",
            text: `${a} + ${b} = ${result}`,
          },
        ],
      };
    }
  • Input schema defining 'a' and 'b' as required number properties for the 'add' tool.
    inputSchema: {
      type: "object",
      properties: {
        a: {
          type: "number",
          description: "First number to add",
        },
        b: {
          type: "number",
          description: "Second number to add",
        },
      },
      required: ["a", "b"],
    },
  • src/index.ts:20-37 (registration)
    Registration of the 'add' tool in the ListTools response, including name, description, and schema.
    {
      name: "add",
      description: "Add two numbers together",
      inputSchema: {
        type: "object",
        properties: {
          a: {
            type: "number",
            description: "First number to add",
          },
          b: {
            type: "number",
            description: "Second number to add",
          },
        },
        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. While 'Add two numbers together' clearly indicates a computational operation, it doesn't describe error handling, precision limitations, overflow behavior, or return format. For a mathematical tool with zero annotation coverage, this represents a significant gap in behavioral 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 consists of a single, perfectly efficient sentence that communicates the core functionality without any wasted words. It's appropriately sized for this simple mathematical operation and front-loads the essential information immediately.

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 mathematical tool with 100% schema coverage and no output schema, the description adequately communicates the basic operation. However, it lacks information about return values, error conditions, or numerical limitations that would be helpful for an agent. The description meets minimum requirements but could provide more complete context.

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?

Schema description coverage is 100%, with both parameters 'a' and 'b' clearly documented as 'First number to add' and 'Second number to add' respectively. The description adds no additional parameter information beyond what the schema already provides, so the baseline score of 3 is appropriate when the schema does all the heavy lifting.

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 'Add two numbers together' clearly states the specific verb ('add') and resource ('two numbers'), making the purpose immediately obvious. It distinguishes this tool from sibling tools like subtract, multiply, divide, power, and sqrt by specifying the exact 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 Guidelines3/5

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

The description implies usage for addition of two numbers, but provides no explicit guidance on when to use this tool versus alternatives like subtract or multiply. There are no exclusions or prerequisites mentioned, leaving the agent to infer usage from the tool name and context 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/tech-sushant/calculator-mcp'

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