Skip to main content
Glama
dkruyt

Hetzner Cloud MCP Server

by dkruyt

get_server

Retrieve detailed information about a specific Hetzner Cloud server using its unique ID to manage resources and monitor configurations.

Instructions

Get details about a specific server.

Returns detailed information about a server identified by its ID.

Example:
- Get server details: {"server_id": 12345}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the 'get_server' MCP tool. It takes a ServerIdParam, fetches the server using the Hetzner Cloud API client, converts it to a dict using server_to_dict, and returns the server details or an error.
    def get_server(params: ServerIdParam) -> Dict[str, Any]:
        """
        Get details about a specific server.
        
        Returns detailed information about a server identified by its ID.
        
        Example:
        - Get server details: {"server_id": 12345}
        """
        try:
            server = client.servers.get_by_id(params.server_id)
            if not server:
                return {"error": f"Server with ID {params.server_id} not found"}
            
            return {"server": server_to_dict(server)}
        except Exception as e:
            return {"error": f"Failed to get server: {str(e)}"}
  • Pydantic BaseModel defining the input schema for the get_server tool, requiring a 'server_id' integer.
    class ServerIdParam(BaseModel):
        server_id: int = Field(..., description="The ID of the server")
  • Helper function that converts a Hetzner Cloud Server object to a structured dictionary used in the get_server tool response.
    def server_to_dict(server: Server) -> Dict[str, Any]:
        """Convert a Server object to a dictionary with relevant information."""
        return {
            "id": server.id,
            "name": server.name,
            "status": server.status,
            "created": server.created.isoformat() if server.created else None,
            "server_type": server.server_type.name if server.server_type else None,
            "image": server.image.name if server.image else None,
            "datacenter": server.datacenter.name if server.datacenter else None,
            "location": server.datacenter.location.name if server.datacenter and server.datacenter.location else None,
            "public_net": {
                "ipv4": server.public_net.ipv4.ip if server.public_net and server.public_net.ipv4 else None,
                "ipv6": server.public_net.ipv6.ip if server.public_net and server.public_net.ipv6 else None,
            },
            "included_traffic": server.included_traffic,
            "outgoing_traffic": server.outgoing_traffic,
            "ingoing_traffic": server.ingoing_traffic,
            "backup_window": server.backup_window,
            "rescue_enabled": server.rescue_enabled,
            "locked": server.locked,
            "protection": {
                "delete": server.protection["delete"] if server.protection else False,
                "rebuild": server.protection["rebuild"] if server.protection else False,
            },
            "labels": server.labels,
            "volumes": [volume.id for volume in server.volumes] if server.volumes else [],
        }
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 of behavioral disclosure. It states this is a read operation ('get details'), which implies it's non-destructive, but doesn't cover aspects like authentication requirements, rate limits, error handling, or what 'detailed information' includes. For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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

Conciseness5/5

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

The description is appropriately sized and front-loaded: the first sentence states the purpose clearly, the second elaborates, and the example provides concrete usage without unnecessary details. Every sentence adds value, and there's no redundancy or fluff, making it efficient and well-structured.

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

Completeness4/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) and the presence of an output schema (which handles return values), the description is reasonably complete. It covers the purpose and parameter usage adequately. However, the lack of annotations and minimal behavioral context (e.g., no mention of permissions or errors) prevents a perfect score, as some gaps remain for a tool with zero annotation coverage.

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 parameter is 'server_id' and provides an example with a numeric ID, which clarifies the parameter's role beyond the schema's basic type definition. However, it doesn't explain constraints like valid ID ranges or format, leaving some ambiguity. With low coverage, this partial compensation earns a baseline score.

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 server' and 'Returns detailed information about a server identified by its ID.' This specifies the verb ('get details') and resource ('server'), making the purpose unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'list_servers' or 'get_firewall', which would require a 5.

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_servers' (for listing multiple servers) or 'get_firewall' (for similar get operations on different resources), nor does it specify prerequisites or exclusions. The example shows usage but doesn't contextualize it relative to other options.

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