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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

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
Behavior2/5

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

With no annotations provided, the description carries full burden but only states the basic operation. It doesn't disclose behavioral traits like error handling (e.g., division by zero), performance characteristics, or any constraints beyond what's implied by the operation itself.

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 the core purpose in the first sentence. The Args and Returns sections are structured efficiently with no wasted words, making it easy to parse.

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 and the presence of an output schema (which handles return values), the description is mostly complete. It covers purpose and parameters adequately, though it lacks error-handling details which would be helpful for a division operation.

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

Parameters4/5

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

Schema description coverage is 0%, so the description must compensate. It adds clear meaning by specifying 'a' as the dividend and 'b' as the divisor, which goes beyond the schema's generic titles ('A', 'B'). However, it doesn't detail constraints like non-zero divisor or integer-specific behavior.

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 ('Divide') with the resource ('first integer by the second'), and distinguishes from sibling tools (add, multiply, subtract) by specifying division rather than other arithmetic operations.

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 integer division but doesn't explicitly state when to use this vs. alternatives like 'multiply' or 'subtract'. It provides basic context (dividing integers) but lacks explicit guidance on exclusions or comparisons to sibling tools.

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