Skip to main content
Glama
Joseph19820124

Example MCP Server

divide

Divide two integer numbers to calculate quotients or split values. Input two numbers to perform division operations.

Instructions

Divide two numbers

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aYes
bYes

Implementation Reference

  • main.py:25-29 (handler)
    The handler function implementing the 'divide' tool logic: divides a by b after checking for division by zero.
    def divide(a: int, b: int) -> float:
        """Divide two numbers"""
        if b == 0:
            raise ValueError("Cannot divide by zero")
        return a / b
  • main.py:24-24 (registration)
    The @mcp.tool decorator registers the divide function as an MCP tool.
    @mcp.tool
  • main.py:25-26 (schema)
    Type annotations and docstring define the input schema (two ints) and output (float) for the tool.
    def divide(a: int, b: int) -> float:
        """Divide two numbers"""
Behavior1/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. 'Divide two numbers' fails to mention critical behaviors: it doesn't warn about division by zero errors, specify integer division behavior (e.g., truncation), or describe the output format. For a mutation tool with zero annotation coverage, this is a significant gap.

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 extremely concise with just three words, front-loading the core action without any waste. Every word ('Divide', 'two', 'numbers') earns its place by conveying essential information efficiently.

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

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (simple arithmetic), lack of annotations, and no output schema, the description is incomplete. It doesn't cover behavioral aspects like error handling or output format, and with 0% schema coverage, it fails to provide adequate context for safe and correct usage.

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

Parameters2/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 for undocumented parameters. 'Divide two numbers' implies two parameters (dividend and divisor) but adds no meaning beyond the schema's property names 'a' and 'b'. It doesn't explain parameter roles, constraints (e.g., 'b' cannot be zero), or examples, leaving semantics unclear.

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 'Divide two numbers' clearly states the verb (divide) and resource (numbers), making the purpose immediately understandable. It distinguishes from siblings like 'add', 'multiply', and 'subtract' by specifying division. However, it doesn't specify that these are integers (though the schema does), keeping it at 4 rather than 5.

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. It doesn't mention mathematical contexts, error handling for division by zero, or comparisons to other arithmetic operations like 'multiply' or 'subtract'. Without any usage context, it's minimally helpful.

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/Joseph19820124/joseph_mcp_server'

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