Skip to main content
Glama

cpanel_mysql_list

List MySQL databases and users for a specified cPanel account.

Instructions

List MySQL databases and users 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:340-351 (registration)
    Tool definition/registration for cpanel_mysql_list as a Tool object with name, description, and inputSchema requiring 'account' and 'cpanel_user' parameters.
    Tool(
        name="cpanel_mysql_list",
        description="List MySQL databases and users for a cPanel account",
        inputSchema={
            "type": "object",
            "properties": {
                **ACCOUNT_PARAM,
                "cpanel_user": {"type": "string"}
            },
            "required": ["account", "cpanel_user"]
        }
    ),
  • Handler for cpanel_mysql_list: calls cPanel UAPI Mysql::list_databases and Mysql::list_users via WHM-proxied API and returns combined result.
    case "cpanel_mysql_list":
        dbs = await _get(client, url("Mysql", "list_databases"), headers)
        users = await _get(client, url("Mysql", "list_users"), headers)
        return {"databases": dbs, "users": users}
  • Helper function _cpanel_url builds the WHM-proxied cPanel UAPI URL used by the handler to call Mysql::list_databases and Mysql::list_users.
    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 function _get used by the handler to perform async HTTP GET requests to the WHM/cPanel 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)}
  • src/server.py:34-44 (registration)
    Server registration: cpanel_tools() (which includes cpanel_mysql_list) is registered via list_tools() and dispatched via call_tool() which routes 'cpanel_' prefixed tools to handle_cpanel_tool.
    @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
Behavior2/5

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

With no annotations available, the description must convey behavioral traits. It only states that the tool lists databases and users, implying a read operation, but fails to disclose permissions needed, scope limitations, or error handling. No output schema or additional behavioral details are provided.

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

Conciseness4/5

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

The description is a single, concise sentence that front-loads the purpose. It is efficiently written with no unnecessary words, though it could be slightly expanded to cover parameter details.

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

Completeness2/5

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

For a simple list tool, the description minimally covers functionality but omits parameter details for 'cpanel_user', usage context, and output format. Given the lack of output schema and annotations, the description is incomplete for an agent to use correctly without additional inference.

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% (only 'account' has a description). The tool description does not clarify the 'cpanel_user' parameter or provide any additional semantics beyond the schema. Baseline compensation for low schema coverage is expected but missing.

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 action ('List'), the resource ('MySQL databases and users'), and the scope ('for a cPanel account'). It is a specific verb+resource combination that effectively differentiates it from sibling tools like whm_mysql_list_dbs.

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 is provided on when to use this tool versus alternatives such as whm_mysql_list_dbs or other listing tools. The description lacks context about prerequisites or typical use cases.

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