Skip to main content
Glama

add

Perform basic addition of two numbers using this tool. Input two numerical values to calculate their sum quickly and accurately.

Instructions

簡單的加法計算工具

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aYes
bYes

Implementation Reference

  • main.ts:28-30 (handler)
    The asynchronous handler function that takes two numbers a and b, computes their sum, and returns it as a text content block.
    async ({ a, b }) => ({ content: [{ type: "text", text: String(a + b) }] })
  • main.ts:27-27 (schema)
    Zod schema defining input parameters a and b as numbers.
    { a: z.number(), b: z.number() },
  • main.ts:26-31 (registration)
    Registers the 'add' tool with name, description, schema, and inline handler on the MCP server.
    server.tool("add", "簡單的加法計算工具", { a: z.number(), b: z.number() }, async ({ a, b }) => ({ content: [{ type: "text", text: String(a + b) }] }) );

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/GonTwVn/GonMCPtool'

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