Skip to main content
Glama
gemyago

HelloWorld MCP Server

by gemyago

add

Calculate the sum of two numbers using the tool from HelloWorld MCP Server. Input two numerical values (a and b) to receive their total.

Instructions

Add two numbers together

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aYesFirst number
bYesSecond number

Implementation Reference

  • Handler for the 'add' tool: destructures arguments a and b, computes their sum, and returns a textual response with the calculation.
    case 'add': { const { a, b } = args as { a: number; b: number }; const result = a + b; return { content: [ { type: 'text', text: `${a} + ${b} = ${result}`, }, ], }; }
  • src/index.ts:42-59 (registration)
    Tool registration in ListToolsRequestHandler, defining name, description, and input schema for 'add' tool.
    { 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'], }, },
  • TypeScript interface definition for the 'add' tool input and output (unused in current implementation).
    add(args: { a: number; b: number }): { content: Array<{ type: 'text'; text: string }>; };
  • Alternative handler implementation for 'add' tool in createTools function (appears unused).
    add(args: { a: number; b: number }) { const result = args.a + args.b; return { content: [ { type: 'text', text: `${args.a} + ${args.b} = ${result}`, }, ], }; },

Other Tools

Related Tools

  • @hongsw/hello-mcp
  • @mikefey/mcp-server
  • @wrtnlabs/calculator-mcp
  • @zhangzhefang-github/mcp-add-server
  • @githubpradeep/calc-mcp71
  • @githubpradeep/calc-mcp72

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