Skip to main content
Glama
wrtnlabs

Calculator MCP

by wrtnlabs

mul

Multiply two numbers to compute their product. Solves basic arithmetic multiplication needs.

Instructions

Multiply two numbers

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aYes
bYes

Implementation Reference

  • The async handler function that performs multiplication: extracts params a and b, computes a * b, and returns a text result.
      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: name 'mul', description 'Multiply two numbers', inputSchema expecting {a: number, b: number}.
    schema: {
      name: "mul",
      description: "Multiply two numbers",
      inputSchema: zodToJsonSchema(z.object({ a: z.number(), b: z.number() })),
    },
  • src/server.ts:7-9 (registration)
    Import of 'mul' from './tools' and inclusion in the tools array used for registration.
    import { add, div, mod, mul, sqrt, sub } from "./tools";
    
    const tools = [add, div, mod, mul, sqrt, sub];
  • Re-export of the 'mul' module via './mul'.
    export * from "./mul";
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, and the description does not disclose behavioral traits such as return type, overflow handling, or behavior for non-integer inputs. For a computation tool, this is insufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single concise sentence, front-loading the essential information without any extraneous words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity, the description is minimally adequate. However, with no output schema and no behavioral details, it leaves gaps about return value and edge cases, making it incomplete for a comprehensive understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, and the description does not add any meaning beyond the schema. It fails to explain parameters 'a' and 'b' even minimally, so the description does not compensate for the lack of schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Multiply two numbers' clearly states the action (multiply) and the resource (two numbers), distinguishing it from sibling tools like add, div, mod, sqrt, sub.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool vs alternatives. It lacks explicit context or exclusions, leaving the agent to infer based solely on the tool name.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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