Skip to main content
Glama
DIodide

DillyDallyMCP

by DIodide

add_integers

Calculate the sum of two integers by providing both numbers as input to get their total value.

Instructions

Adds two integers together

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aYesFirst integer
bYesSecond integer

Implementation Reference

  • The handler function that implements the core logic of the add_integers tool: validates input arguments, adds two numbers, and returns the result or error.
    export async function handleAddIntegers( args: unknown ): Promise<CallToolResult> { if (!args || typeof args !== "object") { return { content: [ { type: "text", text: "Error: Arguments must be an object", }, ], isError: true, }; } const { a, b } = args as { a?: unknown; b?: unknown }; if (typeof a !== "number" || typeof b !== "number") { return { content: [ { type: "text", text: "Error: Both a and b must be numbers", }, ], isError: true, }; } const result = a + b; return { content: [ { type: "text", text: `Result: ${result}`, }, ], isError: false, }; }
  • The tool definition object specifying the name, description, and input schema (parameters a and b as numbers).
    export const addIntegersToolDefinition: Tool = { name: "add_integers", description: "Adds two integers together", inputSchema: { type: "object", properties: { a: { type: "number", description: "First integer", }, b: { type: "number", description: "Second integer", }, }, required: ["a", "b"], }, };
  • tools/index.ts:68-72 (registration)
    The registration of the add_integers tool in the central toolRegistry Map, linking its definition and handler.
    "add_integers", { definition: addIntegersToolDefinition, handler: handleAddIntegers, },

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/DIodide/DillyDallyMCP'

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