Skip to main content
Glama

cpanel_subdomains_list

Retrieve a complete list of subdomains and addon domains for a cPanel account.

Instructions

List all subdomains and addon domains for a cPanel account

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accountYesAccount alias from accounts.json (use list_accounts to see options)
cpanel_userYes

Implementation Reference

  • src/tools.py:388-399 (registration)
    Tool registration/definition for 'cpanel_subdomains_list' inside the cpanel_tools() function. Defines name, description, and inputSchema (requires account and cpanel_user).
    Tool(
        name="cpanel_subdomains_list",
        description="List all subdomains and addon domains for a cPanel account",
        inputSchema={
            "type": "object",
            "properties": {
                **ACCOUNT_PARAM,
                "cpanel_user": {"type": "string"}
            },
            "required": ["account", "cpanel_user"]
        }
    ),
  • Handler for 'cpanel_subdomains_list' inside handle_cpanel_tool(). Calls UAPI SubDomain::list_subdomains and AddonDomain::list_addon_domains via _get helper and returns combined result.
    case "cpanel_subdomains_list":
        subs = await _get(client, url("SubDomain", "list_subdomains"), headers)
        addons = await _get(client, url("AddonDomain", "list_addon_domains"), headers)
        return {"subdomains": subs, "addon_domains": addons}
  • Helper _cpanel_url() constructs the WHM-proxied UAPI URL for cPanel operations, used by the handler to build API endpoints.
    def _cpanel_url(account: dict, module: str, function: str, cpanel_user: str = None) -> str:
        host = account["host"]
        port = account.get("port", 2087)
        # WHM-proxied UAPI call on behalf of a cPanel user
        user = cpanel_user or account.get("cpanel_user", "")
        return f"https://{host}:{port}/json-api/cpanel?api.version=1&cpanel_jsonapi_user={user}&cpanel_jsonapi_module={module}&cpanel_jsonapi_func={function}&cpanel_jsonapi_apiversion=3"
  • Helper _get() is an async HTTP GET wrapper used by the handler to call WHM/cPanel APIs.
    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)}
  • src/server.py:67-71 (registration)
    Dispatch to handle_cpanel_tool when tool name starts with 'cpanel_', as seen in the call_tool() function.
    async with httpx.AsyncClient(verify=False, timeout=30) as client:
        if name.startswith("whm_"):
            result = await handle_whm_tool(client, account, name, arguments)
        elif name.startswith("cpanel_"):
            result = await handle_cpanel_tool(client, account, name, arguments)
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are present, so the description must carry the full burden. It only states the basic function without disclosing behavioral traits such as required permissions, read-only nature, or side effects beyond listing.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence, no fluff, directly states the tool's action and scope.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple list operation, the description is adequate but lacks details on output format or pagination. With no output schema, the agent might need more context on what the response contains.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 50%; one parameter (cpanel_user) lacks a description. The tool description does not add any extra meaning beyond the schema's parameter descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'List' and the resources 'subdomains and addon domains', distinguishing it from sibling list tools like cpanel_email_list or cpanel_dns_records.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives like cpanel_dns_records. No when-not or prerequisite information is provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/manofsadness/ItchWHMMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server