Skip to main content
Glama
psaboia
by psaboia

calculate_sum

Add two numbers together to compute their total sum. Use this tool to perform basic arithmetic addition operations.

Instructions

Add two numbers together

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aYes
bYes

Implementation Reference

  • The handler logic for the 'calculate_sum' tool within the CallToolRequestSchema handler. It validates input arguments 'a' and 'b' as numbers and returns their sum as toolResult.
    if (request.params.name === "calculate_sum") {
      const args = request.params.arguments as { a: number; b: number };
      if (typeof args?.a !== 'number' || typeof args?.b !== 'number') {
        throw new McpError(ErrorCode.InvalidRequest, "Arguments 'a' and 'b' must be numbers");
      }
      return { toolResult: args.a + args.b} ;
    }
  • Input schema definition for the 'calculate_sum' tool, specifying an object with required number properties 'a' and 'b'.
    inputSchema: {
      type: "object",
      properties: {
        a: { type: "number" },
        b: { type: "number" }
      },
      required: ["a", "b"]
    }
  • src/index.ts:25-35 (registration)
    Registration of the 'calculate_sum' tool in the ListToolsRequestSchema handler, including name, description, and input schema.
      name: "calculate_sum",
      description: "Add two numbers together",
      inputSchema: {
        type: "object",
        properties: {
          a: { type: "number" },
          b: { type: "number" }
        },
        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 states the action ('Add') but does not cover traits like error handling, performance, or side effects. For a simple tool, this is a gap, though not severe, as addition is a basic operation with minimal behavioral complexity.

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, direct sentence with no wasted words, making it highly concise and front-loaded. It efficiently communicates the core function without unnecessary elaboration.

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 addition with two parameters), no annotations, and no output schema, the description is adequate but minimal. It covers the basic purpose but lacks details on usage, behavior, or output, making it incomplete for more nuanced agent decisions.

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 mentions 'two numbers', which aligns with the two parameters 'a' and 'b' in the schema, but schema description coverage is 0%, so no details are provided in the schema. The description adds minimal semantics by indicating the parameters are numbers for addition, but does not explain their roles or constraints beyond that.

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 'Add two numbers together' clearly states the verb ('Add') and resource ('two numbers'), making the purpose specific and understandable. However, it does not differentiate from sibling tools, as the only sibling is 'httpbin_json', which is unrelated, so differentiation is not needed but not explicitly addressed.

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 or in what context it should be applied. It lacks any mention of prerequisites, constraints, or comparison with other tools, leaving usage entirely implicit.

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/psaboia/mcp-server-playground'

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