Skip to main content
Glama

whm_suspend_account

Suspend a cPanel account to disable login, web, and email services by specifying the account and username along with a reason.

Instructions

Suspend a cPanel account (disables login, web, email)

Input Schema

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

Implementation Reference

  • src/tools.py:111-123 (registration)
    Tool registration for 'whm_suspend_account' as an MCP Tool object with input schema requiring 'account' and 'username', with optional 'reason'.
    Tool(
        name="whm_suspend_account",
        description="Suspend a cPanel account (disables login, web, email)",
        inputSchema={
            "type": "object",
            "properties": {
                **ACCOUNT_PARAM,
                "username": {"type": "string"},
                "reason": {"type": "string", "description": "Reason for suspension"}
            },
            "required": ["account", "username"]
        }
    ),
  • Handler for 'whm_suspend_account' in the handle_whm_tool match statement. Builds params with username and optional reason, then calls WHM JSON API 'suspendacct' via GET.
    case "whm_suspend_account":
        params = {"user": args["username"]}
        if "reason" in args:
            params["reason"] = args["reason"]
        return await _get(client, url("suspendacct"), headers, params)
  • Helper _whm_url builds the WHM API URL (https://host:port/json-api/function?api.version=1).
    def _whm_url(account: dict, function: str) -> str:
        host = account["host"]
        port = account.get("port", 2087)
        user = account.get("user", "root")
        return f"https://{host}:{port}/json-api/{function}?api.version=1"
  • Helper _headers builds the Authorization header using WHM token.
    def _headers(account: dict) -> dict:
        token = account["token"]
        user = account.get("user", "root")
        return {
            "Authorization": f"whm {user}:{token}",
            "Content-Type": "application/json"
        }
  • Helper _get performs the async HTTP GET request, returning JSON or an error dict.
    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?

With no annotations, the description provides basic behavioral context (disables login, web, email) but omits details like FTP/database access, reversibility, or data preservation. Adequate but not thorough.

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, direct, and front-loaded with the core action. No extraneous words.

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?

Minimally complete for a suspension tool; lacks details on exact scope and consequences. Acceptable given no output schema and moderate complexity.

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?

Schema coverage is 67% (2 of 3 params described). The description adds no parameter-specific meaning beyond the schema. Baseline score applies as schema does most of the work.

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 tool suspends a cPanel account and specifies what is disabled (login, web, email). It distinguishes from sibling tools like whm_unsuspend_account and whm_terminate_account by implying a temporary, reversible suspension.

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 suspension versus termination or other actions. Does not mention prerequisites or scenarios where suspension is appropriate.

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