Skip to main content
Glama

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
NameRequiredDescriptionDefault
xYes

Implementation Reference

  • 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)

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/vipankumar87/MCP-Example'

If you have feedback or need assistance with the MCP directory API, please join our Discord server