Skip to main content
Glama

addition

Calculate the sum of two numerical values by providing inputs a and b. Input values are validated against a defined schema for accurate results.

Instructions

Add two numbers

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aYes
bYes

Implementation Reference

  • Core handler function that performs the addition of two numbers a and b.
    export function exampleAddition(params: z.infer<typeof AdditionSchema>) { return params.a + params.b; }
  • Zod schema defining the input parameters for the addition tool: two numbers a and b.
    export const AdditionSchema = z.object({ a: z.number(), b: z.number(), });
  • index.ts:39-43 (registration)
    Tool registration in the ListTools response, specifying name, description, and input schema.
    { name: "addition", description: "Add two numbers", inputSchema: zodToJsonSchema(AdditionSchema), }
  • index.ts:62-68 (handler)
    Dispatch handler in CallToolRequestHandler that parses arguments, calls the exampleAddition function, and formats the response.
    case "addition": { const args = AdditionSchema.parse(request.params.arguments); const result = operation.exampleAddition(args); return { content: [{ type: "text", text: result.toString() }], }; }

Other Tools

Related Tools

  • @joeguo911/mcp-demo
  • @Mtar786/mcpServer
  • @liaotaodcx8/toolkittest
  • @Joseph19820124/joseph_mcp_server
  • @riteshbangal/BuildMcpServer
  • @bahfahh/mcptest

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/minimind-org/mcp-server-typescript-template'

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