square_root
Calculate the square root of a number to solve mathematical problems or verify calculations. Enter a numeric value to get its square root result.
Instructions
Calculate the square root of a number.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | Yes |
Implementation Reference
- server.py:100-105 (handler)The handler function for the 'square_root' tool. It takes a float input 'x', validates that it is non-negative, and returns the square root using math.sqrt. Registered via the @mcp.tool() decorator.@mcp.tool() def square_root(x: float) -> float: """Calculate the square root of a number.""" if x < 0: raise ValueError("Cannot calculate square root of negative number") return math.sqrt(x)