Skip to main content
Glama

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];

Other Tools

Related Tools

  • @githubpradeep/calc-mcp72
  • @githubpradeep/calc-mcp72
  • @githubpradeep/calc-mcp71
  • @githubpradeep/calc-mcp71
  • @wrtnlabs/calculator-mcp
  • @wrtnlabs/calculator-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