subtract
Perform subtraction of two numbers using the Arithmetic MCP Server's tool. Input two numerical values to calculate and retrieve the result efficiently.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | ||
| b | Yes |
Implementation Reference
- src/index.ts:25-34 (registration)Registration of the 'subtract' tool, including schema and inline handler function.server.tool( "subtract", { a: z.number(), b: z.number() }, async ({ a, b }) => ({ content: [{ type: "text", text: `${a} と ${b} の引き算の結果: ${a - b}` }] }) );
- src/index.ts:27-27 (schema)Input schema for 'subtract' tool: two numbers a and b using Zod validation.{ a: z.number(), b: z.number() },
- src/index.ts:28-33 (handler)Handler function for 'subtract' tool: computes a - b and returns formatted text content.async ({ a, b }) => ({ content: [{ type: "text", text: `${a} と ${b} の引き算の結果: ${a - b}` }] })