Skip to main content
Glama
wrtnlabs

Calculator MCP

by wrtnlabs

mod

Calculate the modulo of two numbers using the Calculator MCP server. Input two values to determine the remainder after division for precise mathematical results.

Instructions

Mod two numbers

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aYes
bYes

Implementation Reference

  • Handler function that computes the modulo (remainder) of two numbers a and b, returning a formatted text response.
    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 modulo of ${a} and ${b} is ${result}` }] };
    },
  • Schema definition for the 'mod' tool, including name, description, and Zod-based input schema for parameters a and b.
    schema: {
      name: "mod",
      description: "Mod two numbers",
      inputSchema: zodToJsonSchema(z.object({ a: z.number(), b: z.number() })),
    },
  • src/server.ts:7-9 (registration)
    The 'mod' tool is imported from './tools' (which re-exports src/tools/mod.ts) and registered in the tools array used by the MCP server for listTools and callTool requests.
    import { add, div, mod, mul, sqrt, sub } from "./tools";
    
    const tools = [add, div, mod, mul, sqrt, sub];
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure but only states the operation without details. It doesn't cover error handling (e.g., division by zero), output format, or computational traits, leaving significant gaps in understanding how the tool behaves beyond the basic action.

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 extremely concise with a single phrase, 'Mod two numbers', which is front-loaded and wastes no words. It efficiently communicates the core action without unnecessary elaboration, making it easy to parse quickly.

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 simplicity (2 parameters, no annotations, no output schema), the description is incomplete. It doesn't explain the mathematical operation, parameter roles, or result format, leaving the AI agent with insufficient context to use the tool effectively despite the low complexity.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate but adds no meaning beyond the schema. It doesn't explain what 'a' and 'b' represent (e.g., dividend and divisor), their constraints, or the order of operation, failing to address the lack of schema documentation.

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 'Mod two numbers' states the operation (mod) and the resource (two numbers), which is clear but vague. It doesn't specify what 'mod' means (modulo operation) or distinguish it from sibling tools like 'div' (division), leaving room for confusion about the exact mathematical function.

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?

No guidance is provided on when to use this tool versus alternatives like 'div' or other mathematical operations. The description lacks context about use cases (e.g., for remainder calculations) or exclusions, offering minimal help for an AI agent to choose correctly among siblings.

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

  • @wrtnlabs/calculator-mcp
  • @wrtnlabs/calculator-mcp
  • @YuheiNakasaka/arithmetic-mcp-server
  • @shaleen-wonder-ent/simple-mcp-server
  • @kylekanouse/Test-MCP---DEMO-MCP-Dev-1
  • @balajidommeti/MCP

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