Skip to main content
Glama

add

Calculate the sum of two integers by providing values for both numbers to perform addition operations.

Instructions

两个整数的和相加

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aYes
bYes

Implementation Reference

  • Handler function for the 'add' MCP tool. Adds two integers a and b, decorated with @server.tool() for registration.
    @server.tool()
    def add(a: int, b: int) -> int:
        """两个整数的和相加"""
        return a + b
  • The register method in MyModule class where the 'add' tool is registered using @server.tool() decorator.
    def register(self, server):
    
        @server.tool()
        def my_tool(param: str) -> str:
            """自定义工具"""
            return f"处理参数: {param}"
    
        # 一个简单的计算器
        @server.tool()
        def add(a: int, b: int) -> int:
            """两个整数的和相加"""
            return a + b
    
        @server.resource("my://resource")
        def my_resource() -> str:
            """自定义资源"""
            return "资源内容"
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. The description only states the mathematical operation without mentioning any behavioral traits like error handling, performance characteristics, or side effects. For a simple tool, this might be acceptable, but it lacks completeness for an agent to fully understand its behavior.

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

Conciseness5/5

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

The description is extremely concise with a single phrase ('两个整数的和相加'), which is front-loaded and wastes no words. For a simple addition tool, this brevity is appropriate and efficient, making it easy for an agent to parse quickly.

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

Completeness2/5

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

Given the tool's simplicity (2 parameters, no annotations, no output schema), the description is minimal. It states the basic purpose but lacks details on usage, parameters, or behavioral context. While the tool is straightforward, the description doesn't provide enough information for an agent to confidently select and invoke it without additional inference.

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

Parameters2/5

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

The schema description coverage is 0%, so the description must compensate for the lack of parameter documentation. The description mentions '两个整数' (two integers), which aligns with the two parameters 'a' and 'b', but it doesn't add any semantic meaning beyond what's implied by the parameter names. It doesn't explain what 'a' and 'b' represent or any constraints beyond being integers.

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

Purpose3/5

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

The description '两个整数的和相加' (sum of two integers) states what the tool does with a specific verb ('相加' - add/sum) and resource ('整数' - integers), but it's somewhat vague about the exact operation. It doesn't distinguish from siblings like 'hello' or 'server_info', but those are clearly different tools, so differentiation isn't critical here.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention any prerequisites, context for use, or comparisons to other tools. The agent must infer usage solely from the tool name and description without explicit guidelines.

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/gooboot/MCP-BOS'

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