Skip to main content
Glama

divide

Perform division operations by dividing one number by another to calculate quotients and solve mathematical problems.

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. It is decorated with @mcp.tool() for registration in the MCP server and implements the division logic with a check to prevent division by 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

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