Skip to main content
Glama
avanishd-3

Math MCP Server

by avanishd-3

divide

Perform division of two numbers with 64-bit floating point precision. Input integers, decimals, or fractions to calculate quotients accurately.

Instructions

Divides two numbers with 64 bit floating point precision and returns a 64 bit float. For example, dividing 10 by 2 would return 5.0. You can also use fractions if you want to, like 1/2 for number_1 and 1/3 for number_2.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
number_1Yes
number_2Yes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The 'divide' tool handler: divides number_1 by number_2 using NumPy float64, checks for division by zero, rounds result, logs operation.
    @math_mcp.tool
    def divide(
        number_1: int | float,
        number_2: int | float,
    ) -> float:
        """Divides two numbers with 64 bit floating point precision and returns a 64 bit float.
           For example, dividing 10 by 2 would return 5.0.
           You can also use fractions if you want to, like 1/2 for number_1 and 1/3 for number_2.
        """
        if number_2 == 0:
            logging.error("Division by zero error.")
            raise ValueError("Division by zero is not allowed.")
        result = np.round(np.float64(number_1) / np.float64(number_2), decimals=SIXTY_FOUR_BIT_FLOAT_DECIMAL_PLACES)
        logging.info(f"Doing division: {number_1} / {number_2} -> Result: {result}")
        return result
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses the precision (64-bit floating point) and return type, which are useful behavioral traits. However, it does not cover error handling (e.g., division by zero), performance aspects, or other constraints, leaving gaps in behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized with three sentences that are front-loaded: the first states the core functionality, the second gives an example, and the third adds flexibility. There is minimal waste, though the fraction example could be slightly more concise.

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, two parameters with 0% schema coverage, and the presence of an output schema (which handles return values), the description is fairly complete. It covers purpose, parameters, and behavior adequately, though it lacks usage guidelines and some behavioral details like error handling.

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 meaning by explaining that parameters are numbers used for division, provides examples (e.g., 10 and 2, fractions like 1/2), and clarifies they can be integers or numbers. This effectively documents the parameters beyond the bare schema.

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 verb 'divides' and resource 'two numbers', distinguishing it from sibling tools like add, multiply, and subtract by specifying the division operation. It also mentions the precision and return type, making the purpose explicit and distinct.

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 multiply or subtract, nor does it mention any prerequisites or exclusions. It includes an example but lacks context for tool selection.

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/avanishd-3/math-mcp'

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