Skip to main content
Glama

divide

Divide two integer numbers to calculate quotients or split values. Input two numbers to perform division operations.

Instructions

Divide two numbers

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aYes
bYes

Implementation Reference

  • main.py:25-29 (handler)
    The handler function implementing the 'divide' tool logic: divides a by b after checking for division by zero.
    def divide(a: int, b: int) -> float: """Divide two numbers""" if b == 0: raise ValueError("Cannot divide by zero") return a / b
  • main.py:24-24 (registration)
    The @mcp.tool decorator registers the divide function as an MCP tool.
    @mcp.tool
  • main.py:25-26 (schema)
    Type annotations and docstring define the input schema (two ints) and output (float) for the tool.
    def divide(a: int, b: int) -> float: """Divide two numbers"""

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/Joseph19820124/joseph_mcp_server'

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