Skip to main content
Glama
dkruyt

Hetzner Cloud MCP Server

by dkruyt

get_volume

Retrieve detailed information about a specific Hetzner Cloud volume using its unique ID to manage storage resources.

Instructions

Get details about a specific volume.

Returns detailed information about a volume identified by its ID.

Example:
- Get volume details: {"volume_id": 12345}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the 'get_volume' tool. It takes a volume_id parameter, fetches the volume using the Hetzner Cloud API client, converts it to a dictionary using the volume_to_dict helper, and returns the details or an error.
    @mcp.tool()
    def get_volume(params: VolumeIdParam) -> Dict[str, Any]:
        """
        Get details about a specific volume.
        
        Returns detailed information about a volume identified by its ID.
        
        Example:
        - Get volume details: {"volume_id": 12345}
        """
        try:
            volume = client.volumes.get_by_id(params.volume_id)
            if not volume:
                return {"error": f"Volume with ID {params.volume_id} not found"}
            
            return {"volume": volume_to_dict(volume)}
        except Exception as e:
            return {"error": f"Failed to get volume: {str(e)}"}
  • Pydantic BaseModel defining the input schema for the get_volume tool, which requires a single 'volume_id' integer field.
    # Volume ID Parameter Model
    class VolumeIdParam(BaseModel):
        volume_id: int = Field(..., description="The ID of the volume")
  • Supporting utility function that serializes a hcloud.volumes.domain.Volume object into a JSON-serializable dictionary format, used directly in the get_volume handler.
    # Helper function to convert Volume object to dict
    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?

No annotations are provided, so the description carries the full burden. It states this is a read operation ('Get details'), but doesn't disclose behavioral traits like authentication requirements, rate limits, error conditions, or what 'detailed information' includes. The description is minimal and lacks important context for a tool that presumably accesses sensitive infrastructure data.

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 appropriately sized with three sentences: purpose statement, elaboration on return value, and an example. It's front-loaded with the core purpose. The example is helpful but could be more integrated. No wasted words, though it could be slightly more structured.

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 low complexity (single parameter read operation) and the presence of an output schema (which handles return values), the description is somewhat complete. However, with no annotations and minimal behavioral disclosure, it leaves gaps in understanding permissions, errors, and operational context. It's adequate but could better address the read-only nature and resource-specific considerations.

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

Parameters3/5

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

The schema description coverage is 0%, so the description must compensate. It adds meaning by specifying that the volume_id parameter identifies 'a specific volume' and provides an example showing usage. However, it doesn't explain parameter constraints (e.g., valid ID ranges) or format details beyond what's implied. With one parameter and an example, it meets the baseline but doesn't fully compensate for the schema gap.

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 tool's purpose: 'Get details about a specific volume' and 'Returns detailed information about a volume identified by its ID.' This is a specific verb+resource combination (get + volume details). However, it doesn't distinguish this tool from other 'get_' siblings like get_firewall or get_server, which likely have similar patterns but for different resources.

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 sibling tools like list_volumes (which might retrieve multiple volumes) or differentiate from other 'get_' tools. The example shows usage but doesn't provide contextual decision-making criteria.

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