add
Adds two numbers together using the Remote MCP Server's authentication-free calculation service.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | ||
| b | Yes |
Implementation Reference
- src/index.ts:17-19 (handler)The inline handler function for the 'add' tool that adds two input numbers 'a' and 'b' and returns the result as a text content in the MCP response.async ({ a, b }) => ({ content: [{ type: "text", text: String(a + b) }], })
- src/index.ts:16-16 (schema)The Zod input schema for the 'add' tool, defining two required number parameters 'a' and 'b'.{ a: z.number(), b: z.number() },
- src/index.ts:14-20 (registration)The registration of the 'add' tool on the MCP server using server.tool(), including the tool name, input schema, and handler function.this.server.tool( "add", { a: z.number(), b: z.number() }, async ({ a, b }) => ({ content: [{ type: "text", text: String(a + b) }], }) );