Skip to main content
Glama
kelseyee

Calculator MCP

by kelseyee

divide

Perform floating-point division calculations by entering a dividend and non-zero divisor to compute accurate quotients for mathematical problems.

Instructions

执行浮点数除法运算 Args: b: 除数(必须非零)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aYes
bYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function for the 'divide' tool, decorated with @mcp.tool() for registration. It performs floating-point division with a check for division by zero.
    @mcp.tool() 
    def divide(a: float, b: float) -> float:
        """执行浮点数除法运算
        Args:
            b: 除数(必须非零)
        """
        if b == 0:
            raise ValueError("除数不能为零")
        return a / b
  • calculator.py:22-22 (registration)
    Registration of the divide tool using the @mcp.tool() decorator.
    @mcp.tool() 
  • Input schema defined by type hints (a: float, b: float) and output float, with docstring describing parameters.
    def divide(a: float, b: float) -> float:
        """执行浮点数除法运算
        Args:
            b: 除数(必须非零)
        """
Behavior2/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. It mentions that 'b' must be non-zero, which is a critical constraint for division, but doesn't cover other behavioral aspects like error handling (e.g., what happens if b=0), performance characteristics, or return format. For a mathematical tool with zero annotation coverage, this is insufficient.

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

Conciseness3/5

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

The description is brief with two sentences, but the structure is somewhat awkward with 'Args:' inline. It's front-loaded with the main purpose, but the parameter explanation could be better integrated. It avoids unnecessary verbosity but lacks polish in organization.

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 (simple division), two parameters, no annotations, and an output schema present (which likely handles return values), the description is mostly complete. It covers the core operation and a key constraint (non-zero divisor), but could improve by explaining 'a' and error scenarios. The output schema reduces the need for return value details.

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 semantic meaning by explaining that 'b' is the divisor and must be non-zero, which clarifies beyond the schema's generic 'B' title. However, it doesn't describe 'a' (the dividend), leaving one parameter undocumented. The description partially compensates but not fully for the coverage gap.

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 clearly states the tool's purpose as '执行浮点数除法运算' (perform floating-point division operation), which is a specific verb+resource combination. It distinguishes from siblings like add, multiply, and subtract by specifying division, though it doesn't explicitly contrast with them. The purpose is unambiguous but could be more differentiated.

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 other mathematical operations. It mentions that 'b' must be non-zero, which is a constraint but not usage context. There are no explicit when/when-not instructions or references to sibling tools, leaving the agent to infer usage based on the operation name alone.

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/kelseyee/mcp_calculator'

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