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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

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()
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden but only states it 'returns information' without detailing format, pagination, or error behavior. It mentions 'all available' but doesn't clarify if this includes inactive locations or requires specific permissions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose, followed by a clarifying sentence and example. It's efficient with three brief sentences, though the example adds minimal value beyond the first sentence.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 0 parameters, 100% schema coverage, and an output schema exists, the description is minimally adequate. However, as a read-only tool with no annotations, it should ideally mention safety or data format, but the output schema reduces this need.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters with 100% schema coverage, so no parameter documentation is needed. The description appropriately doesn't discuss parameters, earning a baseline high score for not adding unnecessary information.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'List' and resource 'available locations', specifying it returns information about datacenter locations. It distinguishes from siblings like list_servers or list_volumes by focusing on locations, but doesn't explicitly contrast with them.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives is provided. The description doesn't mention prerequisites, timing, or context for selecting list_locations over other list_* tools, leaving usage entirely implicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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