rmdns
Delete a specific DNS host override from Unbound by providing its UUID.
Instructions
Delete a DNS host override from Unbound
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uuid | Yes | UUID of the host override to delete (from dns output) |
Implementation Reference
- opnsense_mcp/tools/rmdns.py:37-77 (handler)The RmdnsTool.execute() method deletes a DNS host override via the OPNsense API. It validates the uuid parameter, calls client.del_host_override(uuid), checks the result, and then calls client.reconfigure_unbound() to apply changes. Returns status 'success' with the uuid on success, or 'error' with details on failure.
async def execute(self, params: dict[str, Any] | None = None) -> dict[str, Any]: """ Delete a DNS host override by UUID and reload Unbound. Args: params: Dict with 'uuid' key. Returns: Dictionary containing the deleted UUID and status. """ if params is None: params = {} if not self.client: return {"status": "error", "error": "No client available"} uuid = params.get("uuid", "").strip() if not uuid: return {"status": "error", "error": "uuid is required"} try: result = await self.client.del_host_override(uuid) if result.get("result") not in ("deleted", "ok", 1): return { "status": "error", "error": f"Delete failed: {result}", } await self.client.reconfigure_unbound() return { "uuid": uuid, "applied": True, "status": "success", } except Exception as e: logger.exception("Failed to delete DNS host override") return {"status": "error", "error": str(e)} - opnsense_mcp/tools/rmdns.py:16-25 (schema)Input schema for the rmdns tool: requires a 'uuid' string property. Defined as class attribute input_schema on RmdnsTool.
input_schema = { "type": "object", "properties": { "uuid": { "type": "string", "description": "UUID of the host override to delete (from dns tool output)", }, }, "required": ["uuid"], } - opnsense_mcp/server.py:96-96 (registration)Import of RmdnsTool from opnsense_mcp.tools.rmdns into the server module.
from opnsense_mcp.tools.rmdns import RmdnsTool - opnsense_mcp/server.py:202-202 (registration)Type annotation in handle_message function: rmdns_tool parameter is typed as RmdnsTool.
rmdns_tool: RmdnsTool, - opnsense_mcp/server.py:621-636 (registration)Tool registration in the tools list: declares the rmdns tool with its name, description, and inputSchema for MCP capabilities.
{ "name": "rmdns", "description": "Delete a DNS host override from Unbound", "inputSchema": { "type": "object", "properties": { "uuid": { "type": "string", "description": ( "UUID of the host override to delete (from dns output)" ), }, }, "required": ["uuid"], }, },