square_root
Calculate the square root of any number to solve mathematical problems and perform precise calculations for equations and measurements.
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 square_root tool handler function, which computes the square root of a non-negative float using math.sqrt, with error handling for negative inputs. The @mcp.tool() decorator registers it with the MCP server.@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)