Skip to main content
Glama

multiply

Calculate the product of two numbers by multiplying them together. Enter two numeric values to get their multiplication result.

Instructions

Multiply two numbers

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aYesFirst number
bYesSecond number

Implementation Reference

  • 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}` } ] })
  • Zod input schema defining two required number parameters: a and b.
    inputSchema: { a: z.number().describe("First number"), b: z.number().describe("Second number") }
  • 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}` } ] }) );

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kylekanouse/Test-MCP---DEMO-MCP-Dev-1'

If you have feedback or need assistance with the MCP directory API, please join our Discord server