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