Skip to main content
Glama
SanLangLOVE

Simple Calculator MCP

by SanLangLOVE

add

Calculate the sum of two numbers using this basic mathematical operation tool. Input two numerical values to get their total.

Instructions

计算两个数字的和

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aYes第一个数字
bYes第二个数字

Implementation Reference

  • The handler for the "add" tool that extracts arguments a and b, computes their sum, and returns a text response with the calculation result.
    case "add": { const { a, b } = args as { a: number; b: number }; const result = a + b; return { content: [ { type: "text", text: `${a} + ${b} = ${result}`, }, ], }; }
  • Defines the input schema for the "add" tool, specifying an object with required number properties 'a' and 'b'.
    inputSchema: { type: "object", properties: { a: { type: "number", description: "第一个数字", }, b: { type: "number", description: "第二个数字", }, }, required: ["a", "b"], },
  • src/index.ts:18-35 (registration)
    Registers the "add" tool in the tools array, including name, description, and input schema, which is returned in response to ListTools requests.
    { name: "add", description: "计算两个数字的和", inputSchema: { type: "object", properties: { a: { type: "number", description: "第一个数字", }, b: { type: "number", description: "第二个数字", }, }, required: ["a", "b"], }, },
Install Server

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/SanLangLOVE/mcp-calculator'

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