Skip to main content
Glama
dkruyt

Hetzner Cloud MCP Server

by dkruyt

delete_firewall

Remove a firewall from Hetzner Cloud infrastructure by specifying its ID to permanently delete the security rule set.

Instructions

Delete a firewall.

Permanently deletes a firewall identified by its ID.

Example:
- Delete firewall: {"firewall_id": 12345}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Implementation Reference

  • The handler function decorated with @mcp.tool() that implements the delete_firewall tool. It retrieves the firewall by ID using the Hetzner client and calls the delete method.
    @mcp.tool()
    def delete_firewall(params: FirewallIdParam) -> Dict[str, Any]:
        """
        Delete a firewall.
        
        Permanently deletes a firewall identified by its ID.
        
        Example:
        - Delete firewall: {"firewall_id": 12345}
        """
        try:
            firewall = client.firewalls.get_by_id(params.firewall_id)
            if not firewall:
                return {"error": f"Firewall with ID {params.firewall_id} not found"}
                
            success = client.firewalls.delete(firewall)
            
            return {"success": success}
        except Exception as e:
            return {"error": f"Failed to delete firewall: {str(e)}"}
  • Pydantic BaseModel schema defining the input parameter 'firewall_id' required by the delete_firewall tool.
    class FirewallIdParam(BaseModel):
        firewall_id: int = Field(..., description="The ID of the firewall")

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