Skip to main content
Glama
dolphinsboy

Test FastMCP

by dolphinsboy

divide

Divide two integers to calculate the quotient. This tool performs basic division operations for mathematical calculations.

Instructions

Divide the first integer by the second.

Args: a: First integer (dividend) b: Second integer (divisor)

Returns: The quotient of a divided by b

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aYes
bYes

Implementation Reference

  • main.py:44-57 (handler)
    The 'divide' tool handler function, decorated with @mcp.tool to register it as an MCP tool. Takes two integers (a, b) as input, validates that b is not zero, and returns the quotient as a float. The type hints (int, float) and docstring provide the schema for input/output validation.
    @mcp.tool
    def divide(a: int, b: int) -> float:
        """Divide the first integer by the second.
        
        Args:
            a: First integer (dividend)
            b: Second integer (divisor)
            
        Returns:
            The quotient of a divided by b
        """
        if b == 0:
            raise ValueError("Cannot divide by zero")
        return a / b
  • main.py:44-44 (registration)
    The @mcp.tool decorator registers the divide function as an MCP tool with the FastMCP framework.
    @mcp.tool
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