Skip to main content
Glama

calculate_sum

Add two numbers efficiently using a TypeScript-based MCP server tool designed for experimentation and integration with Calude Desktop and Cursor IDE.

Instructions

Add two numbers together

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aYes
bYes

Implementation Reference

  • Handler that validates 'a' and 'b' are numbers and computes their sum as the tool result.
    if (request.params.name === "calculate_sum") { const args = request.params.arguments as { a: number; b: number }; if (typeof args?.a !== 'number' || typeof args?.b !== 'number') { throw new McpError(ErrorCode.InvalidRequest, "Arguments 'a' and 'b' must be numbers"); } return { toolResult: args.a + args.b} ; }
  • Input schema defining required number properties 'a' and 'b' for the calculate_sum tool.
    inputSchema: { type: "object", properties: { a: { type: "number" }, b: { type: "number" } }, required: ["a", "b"] }
  • src/index.ts:25-35 (registration)
    Tool registration in ListTools response, specifying name, description, and input schema.
    name: "calculate_sum", description: "Add two numbers together", inputSchema: { type: "object", properties: { a: { type: "number" }, b: { type: "number" } }, required: ["a", "b"] } },

Other Tools

Related Tools

  • @wrtnlabs/calculator-mcp
  • @haojiasheng/add-number-mcp
  • @feraranas/remote-mcp-server-authless
  • @dynstat/mcp-demo
  • @YuheiNakasaka/arithmetic-mcp-server
  • @zhangzhefang-github/mcp-add-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/psaboia/mcp-server-playground'

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