Skip to main content
Glama

number_add

Add two numbers to calculate their sum. This tool performs basic arithmetic addition for quick mathematical calculations.

Instructions

简单的求和工具,当想要计算两个数字相加后的结果时调用

Input Schema

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

Implementation Reference

  • Handler function that takes two numbers a and b, adds them, converts to string, and returns as text content in the response.
    async ({ a, b }) => ({ content: [{ type: "text", text: String(a + b) }], })
  • Input schema defined using Zod for parameters 'a' and 'b', both required numbers with descriptions.
    { a: z.number().describe("第一个数字"), b: z.number().describe("第二个数字"), },
  • src/index.ts:20-30 (registration)
    Registration of the 'number_add' tool on the MCP server, including name, description, input schema, and handler.
    server.tool( "number_add", "简单的求和工具,当想要计算两个数字相加后的结果时调用", { a: z.number().describe("第一个数字"), b: z.number().describe("第二个数字"), }, async ({ a, b }) => ({ content: [{ type: "text", text: String(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/liaotaodcx8/toolkittest'

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