Skip to main content
Glama

add

Add two numbers together to calculate their sum. Use this tool to perform basic arithmetic addition operations within the MCP Document Server.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aYes
bYes

Implementation Reference

  • The handler function that performs the addition of two numbers 'a' and 'b' and returns the result as text content.
    async ({ a, b }) => ({ content: [{ type: "text", text: String(a + b) }] })
  • Zod schema defining the input parameters 'a' and 'b' as numbers for the 'add' tool.
    { a: z.number(), b: z.number() },
  • tools/index.js:7-12 (registration)
    The registration of the 'add' tool on the MCP server, including name, schema, and handler.
    mcpServer.tool("add", { a: z.number(), b: z.number() }, async ({ a, b }) => ({ content: [{ type: "text", text: String(a + b) }] }) );
  • server.js:21-21 (registration)
    Invocation of registerTools which includes the 'add' tool registration.
    registerTools(mcpServer);
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/motiondesignlv/MCP_server'

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