subtract
Calculate the difference between two numbers by subtracting one from another using this mathematical operation tool.
Instructions
计算两个数字的差
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | 被减数 | |
| b | Yes | 减数 |
Implementation Reference
- src/index.ts:136-147 (handler)Handler for the 'subtract' tool: extracts arguments a and b, computes their difference, and returns a formatted text response.case "subtract": { const { a, b } = args as { a: number; b: number }; const result = a - b; return { content: [ { type: "text", text: `${a} - ${b} = ${result}`, }, ], }; }
- src/index.ts:36-53 (schema)Schema definition for the 'subtract' tool, including name, description, and input schema requiring two number parameters: a (minuend) and b (subtrahend).{ name: "subtract", description: "计算两个数字的差", inputSchema: { type: "object", properties: { a: { type: "number", description: "被减数", }, b: { type: "number", description: "减数", }, }, required: ["a", "b"], }, },