Skip to main content
Glama

divide

Divide one number by another to perform mathematical division operations and calculate quotients.

Instructions

Divide the first number by the second number.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aYes
bYes

Implementation Reference

  • server.py:88-93 (handler)
    The handler function for the 'divide' tool, decorated with @mcp.tool() for registration. It divides a by b, raising ValueError if b is zero.
    @mcp.tool() def divide(a: float, b: float) -> float: """Divide the first number by the second number.""" if b == 0: raise ValueError("Cannot divide by zero") return a / b
  • server.py:88-88 (registration)
    Registration of the divide tool using the @mcp.tool() decorator.
    @mcp.tool()
  • Input schema defined by type annotations: two float parameters a and b, returns float.
    def divide(a: float, b: float) -> float:

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/vipankumar87/MCP-Example'

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