Skip to main content
Glama

MCP Communication Server

by FuzzyCZX

add

Perform addition of two numbers using the MCP Communication Server, enabling real-time data communication and calculations for client applications.

Instructions

Add two numbers

Input Schema

NameRequiredDescriptionDefault
aYes
bYes

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "a": { "type": "number" }, "b": { "type": "number" } }, "required": [ "a", "b" ], "type": "object" }

Implementation Reference

  • The handler function for the 'add' tool. It receives two numbers 'a' and 'b' as input and returns their sum as a text content block.
    async ({ a, b }: { a: number; b: number }) => ({ content: [{ type: "text", text: String(a + b) }] })
  • The input schema for the 'add' tool, defining two required number parameters 'a' and 'b' using Zod validation.
    inputSchema: { a: z.number(), b: z.number() }
  • src/index.ts:48-57 (registration)
    The registration of the 'add' tool using server.registerTool, including title, description, input schema, and inline handler function.
    server.registerTool("add", { title: "Addition Tool", description: "Add two numbers", inputSchema: { a: z.number(), b: z.number() } }, async ({ a, b }: { a: number; b: number }) => ({ content: [{ type: "text", text: String(a + b) }] }) );

Other Tools

Related Tools

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

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/FuzzyCZX/MCP'

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