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

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
        """
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