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) }],
        })
    );
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden for behavioral disclosure. It states the tool performs addition but doesn't mention error handling (e.g., for non-numeric inputs), performance characteristics, rate limits, or output format. For a simple tool with no annotations, this leaves gaps in understanding how it behaves beyond the basic operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise with a single sentence that directly states the tool's purpose and usage. It's front-loaded with the core function. However, it could be slightly more structured by separating purpose from usage, but it efficiently communicates the essential information without waste.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (simple addition with two parameters), no annotations, and no output schema, the description is minimally adequate. It covers the basic purpose and usage but lacks details on output format, error cases, or behavioral traits. For such a simple tool, this might be sufficient, but it doesn't provide a complete picture for an AI agent to handle edge cases confidently.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, with clear descriptions for both parameters ('第一个数字' and '第二个数字'). The description adds no additional parameter semantics beyond what the schema provides, such as constraints or examples. With high schema coverage, the baseline score of 3 is appropriate as the description doesn't compensate but also doesn't detract.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose as '简单的求和工具' (simple summation tool) and specifies it calculates the sum of two numbers. It distinguishes from the sibling tool 'get_current_time' by focusing on arithmetic calculation rather than time retrieval. However, it doesn't explicitly differentiate from potential other mathematical tools beyond the sibling context.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides implied usage guidance with '当想要计算两个数字相加后的结果时调用' (call when you want to calculate the sum of two numbers), which gives basic context. However, it doesn't offer explicit alternatives, exclusions, or when-not-to-use guidance. The sibling tool 'get_current_time' is unrelated, so no comparison is needed, but the description lacks broader usage context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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