sqrt
Calculate the square root of any number to solve mathematical problems involving root extraction and numerical analysis.
Instructions
计算平方根
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"number": "<number>"
},
"name": "sqrt"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| number | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- calculator.py:39-41 (handler)The handler function implementing the 'sqrt' tool. It takes a float 'number' and returns its square root using math.sqrt.
def sqrt(number: float) -> float: """计算平方根""" return math.sqrt(number) - calculator.py:38-38 (registration)The @mcp.tool() decorator registers the sqrt function as a tool in the FastMCP server.
@mcp.tool()