Skip to main content
Glama
gemyago

HelloWorld MCP Server

by gemyago

add

Calculate the sum of two numbers by providing both values as inputs to perform basic addition operations.

Instructions

Add two numbers together

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aYesFirst number
bYesSecond number

Implementation Reference

  • Executes the 'add' tool: extracts numbers a and b from arguments, computes their sum, and formats a response message 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}`,
          },
        ],
      };
    }
  • Defines the input schema for the 'add' tool, requiring two number properties: a and b.
    inputSchema: {
      type: 'object',
      properties: {
        a: {
          type: 'number',
          description: 'First number',
        },
        b: {
          type: 'number',
          description: 'Second number',
        },
      },
      required: ['a', 'b'],
    },
  • src/index.ts:42-59 (registration)
    Registers the 'add' tool in the ListTools response with its name, description, and input schema.
    {
      name: 'add',
      description: 'Add two numbers together',
      inputSchema: {
        type: 'object',
        properties: {
          a: {
            type: 'number',
            description: 'First number',
          },
          b: {
            type: 'number',
            description: 'Second number',
          },
        },
        required: ['a', 'b'],
      },
    },
  • Alternative or supporting implementation of the 'add' tool handler in the createTools factory function.
    add(args: { a: number; b: number }) {
      const result = args.a + args.b;
      return {
        content: [
          {
            type: 'text',
            text: `${args.a} + ${args.b} = ${result}`,
          },
        ],
      };
    },
  • TypeScript interface definition specifying the input and output types for the 'add' tool.
    add(args: { a: number; b: number }): {
      content: Array<{ type: 'text'; text: string }>;
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. 'Add two numbers together' implies a simple computation but doesn't disclose any behavioral traits like error handling, precision limits, or return format. It's minimal and lacks context about what the tool actually does 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.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise ('Add two numbers together')—a single sentence that front-loads the core purpose with zero waste. Every word earns its place, making it highly efficient and well-structured for its simplicity.

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 arithmetic), no annotations, no output schema, and high schema coverage, the description is minimally adequate. It states what the tool does but lacks details on behavior or output, making it complete enough for basic understanding but with clear gaps for an agent needing full 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?

The input schema has 100% description coverage with clear parameter descriptions ('First number', 'Second number'), so the baseline is 3. The description 'Add two numbers together' aligns with the schema but doesn't add meaningful semantic context beyond what's already documented in the structured fields.

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 immediately understandable. However, it doesn't distinguish from sibling tools (only 'hello' exists, which is unrelated), so it doesn't fully meet the highest standard of sibling differentiation.

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 any context, prerequisites, or exclusions. While the sibling tool 'hello' is unrelated, there's no explicit comparison or usage context provided.

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/gemyago/typescript-mcp-boilerplate'

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