Skip to main content
Glama

add

Calculate the sum of two numbers by inputting numerical values for addition operations.

Instructions

Add two numbers together

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aYesFirst number to add
bYesSecond number to add

Implementation Reference

  • demo.ts:94-105 (handler)
    Handler logic for the 'add' tool: extracts parameters a and b, computes their sum, and returns a text response with the result.
    if (name === "add") { const { a, b } = args as { a: number; b: number }; const result = a + b; return { content: [ { type: "text", text: `The sum of ${a} and ${b} is ${result}`, }, ], }; }
  • demo.ts:25-42 (schema)
    Schema definition for the 'add' tool, including name, description, and input schema with required number parameters a and b.
    { 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"], }, },
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/joeguo911/mcp-demo'

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