Skip to main content
Glama
dkruyt

Hetzner Cloud MCP Server

by dkruyt

list_volumes

Retrieve and view all storage volumes in your Hetzner Cloud account with their details.

Instructions

List all volumes in your Hetzner Cloud account.

Returns a list of all volume instances with their details.

Example:
- Basic list: list_volumes()

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function for the 'list_volumes' tool. It is registered via the @mcp.tool() decorator and implements the core logic: retrieves all volumes using the Hetzner client and formats them into a dictionary using the volume_to_dict helper.
    def list_volumes() -> Dict[str, Any]:
        """
        List all volumes in your Hetzner Cloud account.
        
        Returns a list of all volume instances with their details.
        
        Example:
        - Basic list: list_volumes()
        """
        try:
            volumes = client.volumes.get_all()
            return {
                "volumes": [volume_to_dict(volume) for volume in volumes]
            }
        except Exception as e:
            return {"error": f"Failed to list volumes: {str(e)}"}
  • Helper function that converts a Hetzner Volume domain object to a serializable dictionary, used by the list_volumes handler to format the response.
    def volume_to_dict(volume: Volume) -> Dict[str, Any]:
        """Convert a Volume object to a dictionary with relevant information."""
        return {
            "id": volume.id,
            "name": volume.name,
            "size": volume.size,
            "location": volume.location.name if volume.location else None,
            "server": volume.server.id if volume.server else None,
            "linux_device": volume.linux_device,
            "protection": {
                "delete": volume.protection["delete"] if volume.protection else False,
            },
            "labels": volume.labels,
            "format": volume.format,
            "created": volume.created.isoformat() if volume.created else None,
            "status": volume.status,
        }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the return type ('list of all volume instances with their details') but lacks critical details like pagination, rate limits, error handling, or authentication requirements, which are essential for a cloud API tool.

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 return details and an example. It's efficient with three sentences, though the example could be more informative (e.g., showing output format) to enhance clarity without adding bulk.

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 the tool's simplicity (0 parameters, output schema exists), the description is adequate but incomplete. It covers the basic operation and return type but misses behavioral aspects like pagination or error cases, which are important even for simple list tools in cloud contexts.

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, and the input schema coverage is 100%, so there's no need for parameter details in the description. The description correctly avoids redundant information, earning a high baseline score for not adding unnecessary content.

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 ('all volumes in your Hetzner Cloud account'), making the purpose unambiguous. However, it doesn't differentiate from sibling tools like 'list_firewalls' or 'list_servers' beyond the resource type, which is a minor gap.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, such as authentication or account setup, or compare it to other list tools like 'list_volumes' vs. 'get_volume' for specific details.

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