Skip to main content
Glama

whm_disk_usage

Retrieve disk usage breakdown for a specific account on a WHM server. Input the account alias to view usage details.

Instructions

Get disk usage breakdown across all accounts on the server

Input Schema

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

Implementation Reference

  • Handler for whm_disk_usage: calls WHM API 'getdiskusage' via GET request.
    case "whm_disk_usage":
        return await _get(client, url("getdiskusage"), headers)
  • Tool definition/schema for whm_disk_usage: describes input (account parameter) for getting disk usage breakdown across all accounts.
    Tool(
        name="whm_disk_usage",
        description="Get disk usage breakdown across all accounts on the server",
        inputSchema={
            "type": "object",
            "properties": ACCOUNT_PARAM,
            "required": ["account"]
        }
    ),
  • src/server.py:34-44 (registration)
    Tools are registered in the list_tools handler which calls whm_tools() to collect all WHM tool definitions including whm_disk_usage.
    @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
  • src/server.py:67-75 (registration)
    Routing: when tool name starts with 'whm_', handle_whm_tool is called, which handles whm_disk_usage in its match/case block.
    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)
        else:
            result = {"error": f"Unknown tool: {name}"}
    
    return [TextContent(type="text", text=json.dumps(result, indent=2))]
  • Helper _get function used by the handler to make the actual API call to WHM.
    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)}
Behavior3/5

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

No annotations are provided, so the description carries full burden. It indicates a read operation ('Get') but does not disclose potential performance impact, permission requirements, or whether the tool is safe to run at any time. Basic transparency but lacking depth.

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, front-loaded with the action and resource. No extraneous information. Highly concise.

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 one-parameter tool, the description fails to explain what the breakdown includes (e.g., per-user, per-domain), nor does it describe the return format. Since no output schema exists, more detail would be helpful.

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 coverage is 100%, so baseline is 3. However, the description ('across all accounts') contradicts the required 'account' parameter which filters to a single account. This inconsistency reduces clarity and adds confusion beyond the schema.

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 uses a specific verb ('Get') and resource ('disk usage breakdown') with scope ('across all accounts on the server'). It clearly distinguishes from siblings like cpanel_disk_usage.

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

Usage Guidelines3/5

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

The description implies server-wide scope but does not explicitly state when to use this tool versus per-account disk usage tools (e.g., cpanel_disk_usage) or other WHM tools. No when-not-to guidance 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