add
Perform addition of two numbers using the MCP Document Server to streamline calculations within markdown document workflows.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | ||
| b | Yes |
Implementation Reference
- tools/index.js:9-11 (handler)Handler function that adds two numbers 'a' and 'b' and returns the result as a text content block.async ({ a, b }) => ({ content: [{ type: "text", text: String(a + b) }] })
- tools/index.js:8-8 (schema)Input schema using Zod defining two required number parameters 'a' and 'b' for the 'add' tool.{ a: z.number(), b: z.number() },
- tools/index.js:7-12 (registration)Registration of the 'add' tool using mcpServer.tool(), including schema and inline 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 function which registers the 'add' tool among others.registerTools(mcpServer);
- server.js:6-6 (registration)Import of the registerTools function from tools/index.js.import { registerTools } from './tools/index.js';