whm_list_packages
List all hosting packages/plans configured on a WHM server for a given account alias.
Instructions
List all hosting packages/plans configured on the WHM server
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| account | Yes | Account alias from accounts.json (use list_accounts to see options) |
Implementation Reference
- src/tools.py:470-471 (handler)Handler for whm_list_packages tool – calls WHM JSON API 'listpkgs' endpoint to list all hosting packages/plans.
case "whm_list_packages": return await _get(client, url("listpkgs"), headers) - src/tools.py:180-188 (schema)Schema/definition for whm_list_packages tool – requires only 'account' parameter.
Tool( name="whm_list_packages", description="List all hosting packages/plans configured on the WHM server", inputSchema={ "type": "object", "properties": ACCOUNT_PARAM, "required": ["account"] } ), - src/server.py:42-44 (registration)Registration of all WHM tools (including whm_list_packages) via whm_tools() function call from src/tools.py.
all_tools.extend(whm_tools()) all_tools.extend(cpanel_tools()) return all_tools - src/tools.py:34-41 (helper)Shared helper function _get used to make async HTTP GET requests to WHM API.
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)}