multiply
Calculate the product of two numbers using multiplication. This tool performs basic arithmetic operations to multiply numerical values.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | ||
| b | Yes |
Implementation Reference
- src/index.ts:40-45 (handler)Handler function for the 'multiply' tool that multiplies inputs 'a' and 'b' and returns the result in Japanese text format.async ({ a, b }) => ({ content: [{ type: "text", text: `${a} と ${b} の掛け算の結果: ${a * b}` }] })
- src/index.ts:39-39 (schema)Input schema for the 'multiply' tool, defining two number parameters 'a' and 'b' using Zod.{ a: z.number(), b: z.number() },
- src/index.ts:37-46 (registration)Registration of the 'multiply' tool using server.tool(), including schema and inline handler.server.tool( "multiply", { a: z.number(), b: z.number() }, async ({ a, b }) => ({ content: [{ type: "text", text: `${a} と ${b} の掛け算の結果: ${a * b}` }] }) );