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
| Name | Required | Description | Default |
|---|---|---|---|
| params | Yes |
Implementation Reference
- mcp_hetzner/server.py:772-791 (handler)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)}"}
- mcp_hetzner/server.py:173-174 (schema)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")