Skip to main content
Glama
xiaoyuchenhot

MCP Multi-Tool Server

subtract

Calculate the difference between two numbers by subtracting the second from the first. This mathematical tool performs subtraction operations to find numerical results.

Instructions

Subtract the second number from the first number.

Args:
    a: The first number (minuend)
    b: The second number (subtrahend)

Returns:
    The difference of a and b (a - b)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aYes
bYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • server.py:41-53 (handler)
    The subtract tool handler function. It subtracts the second argument from the first and is registered as an MCP tool via the @mcp.tool() decorator. Input schema defined by type hints (a: float, b: float) and output float.
    @mcp.tool()
    def subtract(a: float, b: float) -> float:
        """
        Subtract the second number from the first number.
        
        Args:
            a: The first number (minuend)
            b: The second number (subtrahend)
        
        Returns:
            The difference of a and b (a - b)
        """
        return a - b
Behavior3/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. It describes the core behavior (subtraction) and return value, but doesn't disclose additional traits like error handling for non-numeric inputs, precision limits, or performance characteristics. It's adequate but lacks depth.

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 appropriately sized and front-loaded, with a clear purpose statement followed by structured sections for args and returns. Every sentence earns its place without redundancy.

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

Completeness4/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), 2 parameters, and the presence of an output schema (which handles return values), the description is mostly complete. It covers purpose, parameters, and returns, though it could benefit from more behavioral context.

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

Parameters5/5

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

The description adds significant meaning beyond the input schema, which has 0% coverage. It explains that 'a' is the minuend and 'b' is the subtrahend, clarifying their roles in the subtraction operation, which the schema alone doesn't provide.

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 tool's purpose with a specific verb ('subtract') and resource ('numbers'), and it distinguishes from siblings by specifying the mathematical operation. It's not just restating the name but explaining what subtraction means in this 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 implies usage for subtraction operations but doesn't explicitly state when to use this tool versus alternatives like 'add' or 'divide'. It provides basic context but lacks explicit guidance on when-not-to-use or named alternatives.

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/xiaoyuchenhot/MCP-example'

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