Skip to main content
Glama
dkruyt

Hetzner Cloud MCP Server

by dkruyt

delete_server

Permanently remove a Hetzner Cloud server using its unique ID to decommission resources and stop billing.

Instructions

Delete a server.

Permanently deletes a server identified by its ID.

Example:
- Delete server: {"server_id": 12345}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function for the 'delete_server' MCP tool. It retrieves the server by ID using the Hetzner Cloud client and initiates its deletion, returning the action details.
    @mcp.tool()
    def delete_server(params: ServerIdParam) -> Dict[str, Any]:
        """
        Delete a server.
        
        Permanently deletes a server identified by its ID.
        
        Example:
        - Delete server: {"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"}
                
            action = client.servers.delete(server)
            
            # Don't wait for the action to complete - the method doesn't exist
            return {
                "success": True,
                "action": {
                    "id": action.id,
                    "status": action.status,
                    "command": action.command,
                    "progress": action.progress,
                    "error": action.error,
                    "started": action.started.isoformat() if action.started else None,
                    "finished": action.finished.isoformat() if action.finished else None,
                } if action else None,
            }
        except Exception as e:
            return {"error": f"Failed to delete server: {str(e)}"}
  • Pydantic BaseModel defining the input schema for the delete_server tool (and other server-related tools), requiring a server_id integer.
    class ServerIdParam(BaseModel):
        server_id: int = Field(..., description="The ID of the server")
  • The @mcp.tool() decorator registers the delete_server 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 provided, the description carries the full burden of behavioral disclosure. It states the action is permanent ('Permanently deletes'), which is crucial for a destructive operation. However, it lacks details on permissions required, rate limits, error conditions, or what the output schema returns. For a high-stakes deletion tool, this leaves significant behavioral gaps.

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 concise with three sentences: a simple statement, a clarification of permanence, and an example. Each sentence adds value without redundancy. The structure is front-loaded with the core action. Minor improvement could come from integrating the example more seamlessly.

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 high complexity (destructive operation) and lack of annotations, the description is incomplete. It covers the basic action and permanence but misses critical context like prerequisites, error handling, and output details. The presence of an output schema helps, but the description doesn't leverage it to explain return values or success/failure indicators.

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?

Schema description coverage is 0%, so the description must compensate. It mentions the parameter ('server_id') in the example but doesn't explain its semantics beyond identification. The description adds minimal value over the schema, which already defines 'server_id' as an integer. With only one parameter, the baseline is 4, but the lack of semantic enrichment lowers the 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 action ('Delete') and resource ('a server'), making the purpose immediately understandable. It distinguishes from siblings like 'get_server' or 'list_servers' by specifying deletion rather than retrieval. However, it doesn't explicitly differentiate from other destructive operations like 'delete_firewall' or 'delete_volume' beyond the resource type.

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 (e.g., server must be powered off), consequences (e.g., data loss), or relationships with other tools (e.g., use after 'power_off'). The example shows parameter usage but offers no contextual decision-making help.

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