divide
Perform division of two integers by specifying values for 'a' and 'b'. Leverage the Example MCP Server's integration capabilities for seamless mathematical operations in supported IDEs.
Instructions
Divide two numbers
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | ||
| b | Yes |
Implementation Reference
- main.py:24-29 (handler)The handler function for the 'divide' MCP tool. It divides two integers 'a' by 'b', returns a float result, and raises a ValueError if b is zero. The schema is defined by type hints and docstring.@mcp.tool def divide(a: int, b: int) -> float: """Divide two numbers""" if b == 0: raise ValueError("Cannot divide by zero") return a / b