list_locations
Retrieve all available datacenter locations for Hetzner Cloud resource deployment and management.
Instructions
List available locations.
Returns information about all available datacenter locations.
Example:
- List locations: list_locations()
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- mcp_hetzner/server.py:497-526 (handler)The handler function for the 'list_locations' MCP tool. It retrieves all available Hetzner Cloud locations using the client API and returns a formatted list with details like id, name, description, country, city, coordinates, and network zone. No input parameters required.@mcp.tool() def list_locations() -> Dict[str, Any]: """ List available locations. Returns information about all available datacenter locations. Example: - List locations: list_locations() """ try: locations = client.locations.get_all() return { "locations": [ { "id": location.id, "name": location.name, "description": location.description, "country": location.country, "city": location.city, "latitude": location.latitude, "longitude": location.longitude, "network_zone": location.network_zone } for location in locations ] } except Exception as e: return {"error": f"Failed to list locations: {str(e)}"}
- mcp_hetzner/server.py:497-497 (registration)The @mcp.tool() decorator registers the list_locations function as an MCP tool.@mcp.tool()