Skip to main content
Glama

add

Perform addition calculations by inputting two numbers to get their sum. This tool handles basic arithmetic operations for mathematical computations.

Instructions

簡單的加法計算工具

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aYes
bYes

Implementation Reference

  • main.ts:26-31 (registration)
    Registration of the 'add' tool using server.tool, including inline schema and handler.
    server.tool("add", "簡單的加法計算工具", { a: z.number(), b: z.number() }, 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:28-30 (handler)
    Handler function that adds the two input numbers and returns the result as a text content block.
    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