Skip to main content
Glama

mul

Multiply two numbers quickly and accurately using the 'mul' tool. Input numerical values into the Calculator MCP server to obtain instant results for any multiplication task.

Instructions

Multiply two numbers

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aYes
bYes

Implementation Reference

  • The asynchronous handler function for the 'mul' tool that multiplies the input numbers 'a' and 'b' and returns a textual response with the product.
    handle: async (params) => { const a = params.a as number; const b = params.b as number; const result = a * b; return { content: [{ type: "text", text: `The product of ${a} and ${b} is ${result}` }] }; },
  • The schema definition for the 'mul' tool, specifying the name, description, and input schema (two numbers 'a' and 'b') converted to JSON schema via Zod.
    schema: { name: "mul", description: "Multiply two numbers", inputSchema: zodToJsonSchema(z.object({ a: z.number(), b: z.number() })), },
  • src/server.ts:9-9 (registration)
    The 'mul' tool is registered by including it in the 'tools' array used by the MCP server for tool listing and calling.
    const tools = [add, div, mod, mul, sqrt, sub];
  • src/server.ts:7-7 (registration)
    Import of the 'mul' tool from the tools module in the server setup.
    import { add, div, mod, mul, sqrt, sub } from "./tools";
  • src/tools/index.ts:4-4 (registration)
    Re-export of the 'mul' tool from its implementation file via the tools index.
    export * from "./mul";

Other Tools

Related Tools

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/wrtnlabs/calculator-mcp'

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