Skip to main content
Glama
wrtnlabs

Calculator MCP

by wrtnlabs

div

Perform division of two numbers using the Calculator MCP server for accurate mathematical calculations in structured workflows.

Instructions

Divide two numbers

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aYes
bYes

Implementation Reference

  • The execute function (handle) for the 'div' tool, which divides input numbers a and b and returns the result as text content.
    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 division of ${a} and ${b} is ${result}` }] };
    },
  • The schema definition for the 'div' tool, including name, description, and Zod-based input schema for parameters a and b.
    schema: {
      name: "div",
      description: "Divide two numbers",
      inputSchema: zodToJsonSchema(z.object({ a: z.number(), b: z.number() })),
    },
  • src/server.ts:7-9 (registration)
    Import of the 'div' tool (via index) and registration in the tools array used by the MCP server for listing and calling tools.
    import { add, div, mod, mul, sqrt, sub } from "./tools";
    
    const tools = [add, div, mod, mul, sqrt, sub];
Behavior1/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. The description 'Divide two numbers' doesn't disclose any behavioral traits beyond the basic operation. It doesn't mention error handling (e.g., division by zero), output format, whether it's read-only or destructive, or any performance considerations. This leaves significant gaps for an agent to understand how to use it correctly.

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 'Divide two numbers' is extremely concise with no wasted words. It's front-loaded with the core action and resource, making it easy to parse quickly. Every word earns its place by directly conveying the tool's function.

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

Completeness2/5

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

Given the tool's low complexity (simple arithmetic operation), no annotations, no output schema, and minimal parameter semantics, the description is incomplete. It doesn't cover critical aspects like error cases (e.g., division by zero), output format, or how it differs from sibling tools beyond the operation name. For a tool with 2 parameters and no structured support, more context is needed to be fully helpful.

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

Parameters3/5

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

The input schema has 2 parameters (a and b) with 0% description coverage, meaning the schema provides no semantic information. The description 'Divide two numbers' implies that 'a' and 'b' are the two numbers to divide, but it doesn't specify which is the dividend and divisor, or add any meaning beyond this basic mapping. Since there are 0 parameters with schema descriptions, the baseline is lower, but the description only partially compensates by vaguely associating parameters with the operation.

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

Purpose3/5

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

The description 'Divide two numbers' clearly states the mathematical operation (divide) and the resource (two numbers), which is specific enough to understand the basic function. However, it doesn't distinguish this tool from its sibling tools (add, mod, mul, sqrt, sub) beyond the obvious mathematical operation difference. The purpose is clear but lacks sibling differentiation.

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 versus alternatives. It doesn't mention any specific context, prerequisites, or exclusions (e.g., handling division by zero, when to use 'div' vs 'mod' for remainder operations). There's only an implied usage based on the mathematical operation, but no explicit instructions.

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

Related Tools

  • @YuheiNakasaka/arithmetic-mcp-server
  • @riteshbangal/BuildMcpServer
  • @avanishd-3/math-mcp
  • @kylekanouse/Test-MCP---DEMO-MCP-Dev-1
  • @Joseph19820124/joseph_mcp_server
  • @shaleen-wonder-ent/simple-mcp-server

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