Skip to main content
Glama

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
NameRequiredDescriptionDefault
aYesFirst number
bYesSecond number

Implementation Reference

  • 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}` } ] }) );
  • 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") } },
  • 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}` } ] }) );

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