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
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | ||
| b | Yes |
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"""