Skip to main content
Glama
4geru

MCP LINE Server

by 4geru

add

Calculate the sum of two numbers using this arithmetic tool from the MCP LINE Server for mathematical operations.

Instructions

Add two numbers and return the result

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aYesThe first number
bYesThe second number

Implementation Reference

  • Handler for the 'add' tool: validates arguments using Zod and returns the sum as text content.
    if (name === "add") {
      // zod でパラメータをバリデーション
      const argsSchema = z.object({
        a: z.number(),
        b: z.number(),
      });
    
      const { a, b } = argsSchema.parse(args);
    
      // 足し算を実行
      const result = a + b;
    
      return {
        content: [
          {
            type: "text",
            text: `${a} + ${b} = ${result}`,
          },
        ],
      };
    }
  • Input schema definition for the 'add' tool, declared in the list tools response.
    inputSchema: {
      type: "object",
      properties: {
        a: {
          type: "number",
          description: "The first number",
        },
        b: {
          type: "number",
          description: "The second number",
        },
      },
      required: ["a", "b"],
    },
  • src/index.ts:23-46 (registration)
    Registration of the ListToolsRequestHandler which lists the 'add' tool with its schema.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: [
          {
            name: "add",
            description: "Add two numbers and return the result",
            inputSchema: {
              type: "object",
              properties: {
                a: {
                  type: "number",
                  description: "The first number",
                },
                b: {
                  type: "number",
                  description: "The second number",
                },
              },
              required: ["a", "b"],
            },
          },
        ],
      };
    });
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the core function (addition) and output (result), but lacks details on error handling, input constraints (e.g., number types, overflow), or performance characteristics. This leaves gaps in understanding how the tool 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.

Conciseness5/5

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

The description is a single, efficient sentence that front-loads the key information ('Add two numbers') and avoids any unnecessary words. Every part of the sentence contributes directly to understanding the tool's function, making it optimally concise and well-structured.

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 arithmetic), no annotations, and no output schema, the description covers the basic purpose adequately. However, it lacks details on return format, error cases, or behavioral nuances that would be helpful for full contextual understanding, making it minimally viable but incomplete.

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 both parameters clearly documented in the schema. The description adds no additional meaning beyond what the schema provides (e.g., it doesn't explain parameter relationships or usage nuances), so it meets the baseline for adequate but not enhanced parameter semantics.

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

Purpose5/5

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

The description clearly states the specific action ('Add two numbers') and the outcome ('return the result'), making the purpose immediately understandable. It uses precise verbs and specifies the resource (numbers), leaving no ambiguity about what the tool does.

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 implies usage for numerical addition, but provides no explicit guidance on when to use this tool versus alternatives (e.g., other mathematical operations). Since there are no sibling tools, the lack of comparative guidance is less critical, but it still offers only basic context without exclusions or prerequisites.

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/4geru/mcp-handson'

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