Skip to main content
Glama

divide

Compute the quotient of a divided by b. Raises an error if b equals zero to prevent division by zero.

Instructions

Divide a by b. Raises if b == 0.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aYes
bYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The divide tool handler: divides a by b, raises ValueError if b is zero.
    @mcp.tool()
    def divide(a: float, b: float) -> float:
        """Divide a by b. Raises if b == 0."""
        if b == 0:
            raise ValueError("Division by zero is not allowed.")
        return a / b
  • The @mcp.tool() decorator registers 'divide' as a FastMCP tool.
    @mcp.tool()
    def divide(a: float, b: float) -> float:
Behavior2/5

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

With no annotations, the description must fully disclose behavior. It only states that division raises an error if b equals zero, but omits details like return type, precision, or overflow behavior, leaving significant gaps.

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 exceptionally concise with two short sentences covering the core operation and key error condition. Every word is informative with no redundancy.

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 existence of an output schema (though not shown), the description is largely complete for a simple arithmetic tool. It covers the operation and main error, though it could briefly note that the result is a number.

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 clarify parameter roles. The phrase 'Divide a by b' explicitly indicates that 'a' is the dividend and 'b' is the divisor, adding critical order information not evident from the schema alone.

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 uses a specific verb 'Divide' and resources 'a' and 'b', clearly defining the operation. It distinguishes from siblings like 'add', 'subtract', and 'multiply' which perform different 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 Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description only implies when to use (when division is needed) but provides no explicit context or alternatives. It does not mention when not to use or compare with related 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/SiegKat/mcp-agent-blackboard'

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