multiply
Calculate the product of two numbers by multiplying them together using this arithmetic tool.
Instructions
Multiply two numbers together
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | First number to multiply | |
| b | Yes | Second number to multiply |
Implementation Reference
- src/index.ts:160-171 (handler)Handler for the 'multiply' tool: destructures arguments 'a' and 'b', computes their product, and returns a formatted text response.case "multiply": { const { a, b } = args as { a: number; b: number }; const result = a * b; return { content: [ { type: "text", text: `${a} × ${b} = ${result}`, }, ], }; }
- src/index.ts:56-73 (registration)Registration of the 'multiply' tool in the ListTools response, including name, description, and input schema defining parameters 'a' and 'b' as required numbers.{ name: "multiply", description: "Multiply two numbers together", inputSchema: { type: "object", properties: { a: { type: "number", description: "First number to multiply", }, b: { type: "number", description: "Second number to multiply", }, }, required: ["a", "b"], }, },
- src/index.ts:59-72 (schema)Input schema for the 'multiply' tool, specifying an object with required number properties 'a' and 'b'.inputSchema: { type: "object", properties: { a: { type: "number", description: "First number to multiply", }, b: { type: "number", description: "Second number to multiply", }, }, required: ["a", "b"], },