multiply
Perform multiplication of two numbers for quick calculations. Designed to process numerical inputs efficiently, enabling users to generate accurate results with minimal steps.
Instructions
Multiply two numbers
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | First number | |
| b | Yes | Second number |
Implementation Reference
- src/tools/calculator-tools.ts:68-76 (handler)The handler function for the 'multiply' tool. Takes two numbers 'a' and 'b', computes their product using a * b, and returns a structured text response with the formatted result.async ({ a, b }) => ({ content: [ { type: "text", text: `${a} × ${b} = ${a * b}` } ] }) );
- src/tools/calculator-tools.ts:60-67 (schema)Input schema for the 'multiply' tool using Zod schemas for two numeric parameters 'a' and 'b'.{ title: "Multiplication Tool", description: "Multiply two numbers", inputSchema: { a: z.number().describe("First number"), b: z.number().describe("Second number") } },
- src/tools/calculator-tools.ts:58-76 (registration)The 'multiply' tool is registered on the MCP server instance using server.registerTool(), providing the tool name, schema, and inline handler function.server.registerTool( "multiply", { title: "Multiplication Tool", description: "Multiply two numbers", inputSchema: { a: z.number().describe("First number"), b: z.number().describe("Second number") } }, async ({ a, b }) => ({ content: [ { type: "text", text: `${a} × ${b} = ${a * b}` } ] }) );