Skip to main content
Glama
dolphinsboy

Test FastMCP

by dolphinsboy

subtract

Calculate the difference between two integers by subtracting the second from the first. This mathematical tool provides subtraction functionality for numerical operations.

Instructions

Subtract the second integer from the first.

Args: a: First integer b: Second integer

Returns: The difference of a and b

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aYes
bYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • main.py:18-29 (handler)
    The 'subtract' MCP tool handler implementation. This function is decorated with @mcp.tool which registers it as an MCP tool. It takes two integers (a and b) and returns their difference (a - b).
    @mcp.tool
    def subtract(a: int, b: int) -> int:
        """Subtract the second integer from the first.
        
        Args:
            a: First integer
            b: Second integer
            
        Returns:
            The difference of a and b
        """
        return a - b
  • main.py:18-18 (registration)
    The @mcp.tool decorator registers the subtract function as an MCP tool with the FastMCP server instance.
    @mcp.tool
  • main.py:19-28 (schema)
    The function signature with type hints (a: int, b: int) -> int and docstring define the input/output schema for the subtract tool, including parameter descriptions and return value documentation.
    def subtract(a: int, b: int) -> int:
        """Subtract the second integer from the first.
        
        Args:
            a: First integer
            b: Second integer
            
        Returns:
            The difference of a and b
        """
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. While it correctly describes the mathematical operation, it doesn't address important behavioral aspects like error handling (e.g., overflow, underflow), performance characteristics, or whether this is a pure function. For a tool with no annotation coverage, this represents a significant gap in behavioral transparency.

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 perfectly structured and concise. It begins with a clear purpose statement, then provides organized sections for Args and Returns. Every sentence earns its place - the first sentence states the operation, the Args section documents parameters, and the Returns section specifies the output. No wasted words or redundant information.

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 simplicity (basic arithmetic operation), 2 parameters, and the existence of an output schema (which handles return value documentation), the description is reasonably complete. It covers the operation, parameters, and return value. However, it could benefit from mentioning sibling tools for context and addressing potential edge cases like integer overflow, which would make it fully complete for this mathematical tool.

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?

With 0% schema description coverage, the description fully compensates by clearly explaining both parameters in the Args section: 'a: First integer' and 'b: Second integer'. It adds essential meaning beyond the bare schema by specifying the order of operation ('subtract the second integer from the first') and clarifying which parameter is subtracted from which. This is exactly what's needed when schema coverage is low.

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 with a specific verb ('subtract') and resource ('the second integer from the first'), making it immediately understandable. It distinguishes from siblings by specifying the subtraction operation rather than addition, multiplication, or division. However, it doesn't explicitly mention the sibling tools or how it differs from them beyond the mathematical operation.

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 like 'add', 'divide', or 'multiply'. It simply states what the tool does mathematically without any context about appropriate use cases, prerequisites, or comparisons to sibling tools. The agent must infer usage from the mathematical operation alone.

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/dolphinsboy/test-fast-mcp'

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