Skip to main content
Glama
dkruyt

Hetzner Cloud MCP Server

by dkruyt

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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)}"}
  • The @mcp.tool() decorator registers the list_locations function as an MCP tool.
    @mcp.tool()

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/dkruyt/mcp-hetzner'

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