Skip to main content
Glama

list_accounts

Retrieve a list of all configured WHM/cPanel server accounts available in this MCP.

Instructions

List all configured WHM/cPanel server accounts available in this MCP

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • src/server.py:34-44 (registration)
    The 'list_accounts' tool is registered as an MCP tool in the list_tools() handler. It is defined with no required input parameters.
    @app.list_tools()
    async def list_tools() -> list[Tool]:
        all_tools = []
        all_tools.append(Tool(
            name="list_accounts",
            description="List all configured WHM/cPanel server accounts available in this MCP",
            inputSchema={"type": "object", "properties": {}, "required": []}
        ))
        all_tools.extend(whm_tools())
        all_tools.extend(cpanel_tools())
        return all_tools
  • The 'list_accounts' tool handler directly inlines its logic in the call_tool() function (lines 51-57). It loads accounts via load_accounts() and returns a JSON list of aliases, hosts, and types.
    @app.call_tool()
    async def call_tool(name: str, arguments: dict[str, Any]) -> list[TextContent]:
        log.info(f"Tool called: {name} | Args: {json.dumps(arguments)}")
    
        if name == "list_accounts":
            accounts = load_accounts()
            result = [
                {"alias": a, "host": cfg["host"], "type": cfg.get("type","whm")}
                for a, cfg in accounts.items()
            ]
            return [TextContent(type="text", text=json.dumps(result, indent=2))]
  • The load_accounts() helper function loads accounts from accounts.json or falls back to environment variables. This is the backing data source for the list_accounts tool.
    def load_accounts() -> dict:
        global _ACCOUNTS
        if _ACCOUNTS is not None:
            return _ACCOUNTS
    
        # Try accounts.json first
        if CONFIG_PATH.exists():
            with open(CONFIG_PATH) as f:
                _ACCOUNTS = json.load(f)
            return _ACCOUNTS
    
        # Fall back to environment variables (single account)
        host = os.environ.get("WHM_HOST")
        user = os.environ.get("WHM_USER", "root")
        token = os.environ.get("WHM_TOKEN")
    
        if host and token:
            _ACCOUNTS = {
                "default": {
                    "host": host,
                    "user": user,
                    "token": token,
                    "type": "whm",
                    "port": int(os.environ.get("WHM_PORT", "2087"))
                }
            }
        else:
            _ACCOUNTS = {}
    
        return _ACCOUNTS
Behavior2/5

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

No annotations are provided, and the description does not disclose behavioral traits such as read-only nature, authentication needs, or potential side effects. It simply lists accounts without indicating safety or scope constraints.

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?

The description is a single sentence that is front-loaded and contains no wasted words. It is optimally concise given the simplicity of the tool.

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

Completeness4/5

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

For a simple list tool with no parameters or output schema, the description communicates the primary function well. However, it does not describe the return format or structure, which could be useful for the agent.

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

Parameters3/5

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

There are zero parameters and schema coverage is 100% trivially, so baseline is 3. The description adds no parameter-specific information beyond the schema, which is empty.

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

Purpose4/5

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

The description clearly states the specific verb 'List' and resource 'WHM/cPanel server accounts available in this MCP'. It is clear but does not explicitly distinguish from the sibling tool 'whm_list_accounts', which likely overlaps.

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 'whm_list_accounts' or 'whm_account_summary'. No exclusions or prerequisites are mentioned.

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