whm_dns_zone_records
Get all DNS records for a domain from a WHM server. Provide the account alias and domain name to retrieve the zone's DNS records.
Instructions
Get all DNS records for a specific zone/domain
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| account | Yes | Account alias from accounts.json (use list_accounts to see options) | |
| domain | Yes | Domain name to query |
Implementation Reference
- src/tools.py:207-217 (registration)Tool registration (definition) for whm_dns_zone_records in the whm_tools() function. Defines name, description, and inputSchema requiring 'account' and 'domain'.
Tool( name="whm_dns_zone_records", description="Get all DNS records for a specific zone/domain", inputSchema={ "type": "object", "properties": { **ACCOUNT_PARAM, "domain": {"type": "string", "description": "Domain name to query"} }, "required": ["account", "domain"] } - src/tools.py:479-480 (handler)Tool handler for whm_dns_zone_records in the handle_whm_tool() function. Calls WHM API 'dumpzone' with the domain parameter.
case "whm_dns_zone_records": return await _get(client, url("dumpzone"), headers, {"domain": args["domain"]}) - src/server.py:67-69 (handler)Dispatcher that invokes handle_whm_tool when the tool name starts with 'whm_', routing call to the handler.
async with httpx.AsyncClient(verify=False, timeout=30) as client: if name.startswith("whm_"): result = await handle_whm_tool(client, account, name, arguments) - src/tools.py:34-40 (helper)The _get helper function used by the handler to make HTTP GET requests to the WHM API and return JSON.
async def _get(client: httpx.AsyncClient, url: str, headers: dict, params: dict = None) -> dict: try: r = await client.get(url, headers=headers, params=params or {}) r.raise_for_status() return r.json() except Exception as e: return {"error": str(e)}