Multiplication Tool
multiplyCalculate the product of two numbers by multiplying them together. Enter two numeric values to get their multiplication result.
Instructions
Multiply two numbers
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"a": "<a>",
"b": "<b>"
},
"name": "multiply"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | First number | |
| b | Yes | Second number |
Implementation Reference
- src/tools/calculator-tools.ts:68-75 (handler)Handler function that multiplies two input numbers a and b, returning a text response with the result in the format 'a × b = result'.
async ({ a, b }) => ({ content: [ { type: "text", text: `${a} × ${b} = ${a * b}` } ] }) - src/tools/calculator-tools.ts:63-66 (schema)Zod input schema defining two required number parameters: a and b.
inputSchema: { a: z.number().describe("First number"), b: z.number().describe("Second number") } - src/tools/calculator-tools.ts:58-76 (registration)Registration of the 'multiply' tool on the MCP server instance, specifying name, title, description, input 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}` } ] }) );