Skip to main content
Glama

whm_change_password

Change the password for a cPanel account by supplying account alias, username, and new password.

Instructions

Change password for a cPanel account

Input Schema

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

Implementation Reference

  • Tool definition and input schema for whm_change_password. Registers the tool with name 'whm_change_password', description 'Change password for a cPanel account', and requires 'account', 'username', and 'password' fields.
    Tool(
        name="whm_change_password",
        description="Change password for a cPanel account",
        inputSchema={
            "type": "object",
            "properties": {
                **ACCOUNT_PARAM,
                "username": {"type": "string"},
                "password": {"type": "string"}
            },
            "required": ["account", "username", "password"]
        }
    ),
  • Handler case for whm_change_password. Calls the WHM JSON API 'passwd' function with the username and password from arguments via HTTP GET.
    case "whm_change_password":
        return await _get(client, url("passwd"), headers, {
            "user": args["username"],
            "password": args["password"]
        })
  • src/tools.py:63-412 (registration)
    The whm_tools() function is called by server.py during list_tools() to register this tool. The whm_change_password tool is part of the WHM tool list returned by this function.
    def whm_tools() -> list[Tool]:
        return [
            Tool(
                name="whm_server_info",
                description="Get WHM server information: hostname, OS, cPanel version, load, uptime",
                inputSchema={
                    "type": "object",
                    "properties": ACCOUNT_PARAM,
                    "required": ["account"]
                }
            ),
            Tool(
                name="whm_list_accounts",
                description="List all cPanel accounts on this WHM server with disk usage, domain, status",
                inputSchema={
                    "type": "object",
                    "properties": {**ACCOUNT_PARAM},
                    "required": ["account"]
                }
            ),
            Tool(
                name="whm_account_summary",
                description="Get detailed summary for a specific cPanel account (disk, bandwidth, emails, DBs)",
                inputSchema={
                    "type": "object",
                    "properties": {
                        **ACCOUNT_PARAM,
                        "username": {"type": "string", "description": "cPanel username to inspect"}
                    },
                    "required": ["account", "username"]
                }
            ),
            Tool(
                name="whm_create_account",
                description="Create a new cPanel hosting account on the WHM server",
                inputSchema={
                    "type": "object",
                    "properties": {
                        **ACCOUNT_PARAM,
                        "username": {"type": "string"},
                        "domain": {"type": "string"},
                        "password": {"type": "string"},
                        "email": {"type": "string"},
                        "plan": {"type": "string", "description": "Hosting plan name (optional)"}
                    },
                    "required": ["account", "username", "domain", "password", "email"]
                }
            ),
            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"]
                }
            ),
            Tool(
                name="whm_unsuspend_account",
                description="Unsuspend/reactivate a suspended cPanel account",
                inputSchema={
                    "type": "object",
                    "properties": {
                        **ACCOUNT_PARAM,
                        "username": {"type": "string"}
                    },
                    "required": ["account", "username"]
                }
            ),
            Tool(
                name="whm_change_password",
                description="Change password for a cPanel account",
                inputSchema={
                    "type": "object",
                    "properties": {
                        **ACCOUNT_PARAM,
                        "username": {"type": "string"},
                        "password": {"type": "string"}
                    },
                    "required": ["account", "username", "password"]
                }
            ),
            Tool(
                name="whm_terminate_account",
                description="⚠️ PERMANENTLY DELETE a cPanel account and all its data",
                inputSchema={
                    "type": "object",
                    "properties": {
                        **ACCOUNT_PARAM,
                        "username": {"type": "string"},
                        "confirm": {"type": "boolean", "description": "Must be true to confirm deletion"}
                    },
                    "required": ["account", "username", "confirm"]
                }
            ),
            Tool(
                name="whm_server_load",
                description="Get real-time server load averages, memory usage, CPU, swap",
                inputSchema={
                    "type": "object",
                    "properties": ACCOUNT_PARAM,
                    "required": ["account"]
                }
            ),
            Tool(
                name="whm_disk_usage",
                description="Get disk usage breakdown across all accounts on the server",
                inputSchema={
                    "type": "object",
                    "properties": ACCOUNT_PARAM,
                    "required": ["account"]
                }
            ),
            Tool(
                name="whm_list_packages",
                description="List all hosting packages/plans configured on the WHM server",
                inputSchema={
                    "type": "object",
                    "properties": ACCOUNT_PARAM,
                    "required": ["account"]
                }
            ),
            Tool(
                name="whm_list_ips",
                description="List all IP addresses on the server and their assignments",
                inputSchema={
                    "type": "object",
                    "properties": ACCOUNT_PARAM,
                    "required": ["account"]
                }
            ),
            Tool(
                name="whm_dns_list_zones",
                description="List all DNS zones managed by this WHM server",
                inputSchema={
                    "type": "object",
                    "properties": ACCOUNT_PARAM,
                    "required": ["account"]
                }
            ),
            Tool(
                name="whm_dns_zone_records",
                description="Get all DNS records for a specific zone/domain",
                inputSchema={
                    "type": "object",
                    "properties": {
                        **ACCOUNT_PARAM,
                        "domain": {"type": "string", "description": "Domain name to query"}
                    },
                    "required": ["account", "domain"]
                }
            ),
            Tool(
                name="whm_mysql_list_dbs",
                description="List all MySQL databases on the server across all accounts",
                inputSchema={
                    "type": "object",
                    "properties": ACCOUNT_PARAM,
                    "required": ["account"]
                }
            ),
            Tool(
                name="whm_bandwidth_usage",
                description="Get bandwidth usage statistics for all accounts or a specific account",
                inputSchema={
                    "type": "object",
                    "properties": {
                        **ACCOUNT_PARAM,
                        "username": {"type": "string", "description": "Filter by cPanel username (optional)"}
                    },
                    "required": ["account"]
                }
            ),
            Tool(
                name="whm_list_services",
                description="Check status of all WHM services (Apache, MySQL, cPanel, SMTP, etc.)",
                inputSchema={
                    "type": "object",
                    "properties": ACCOUNT_PARAM,
                    "required": ["account"]
                }
            ),
            Tool(
                name="whm_restart_service",
                description="Restart a specific service on the WHM server (apache, mysql, exim, etc.)",
                inputSchema={
                    "type": "object",
                    "properties": {
                        **ACCOUNT_PARAM,
                        "service": {"type": "string", "description": "Service name: apache, mysql, exim, ftp, cpsrvd"}
                    },
                    "required": ["account", "service"]
                }
            ),
            Tool(
                name="whm_ssl_list",
                description="List all SSL certificates installed on the server",
                inputSchema={
                    "type": "object",
                    "properties": ACCOUNT_PARAM,
                    "required": ["account"]
                }
            ),
            Tool(
                name="whm_backup_list",
                description="List available backups on the WHM server",
                inputSchema={
                    "type": "object",
                    "properties": ACCOUNT_PARAM,
                    "required": ["account"]
                }
            ),
        ]
    
    
    # ─── cPanel Tool Definitions (account-level) ──────────────────────────────────
    
    def cpanel_tools() -> list[Tool]:
        return [
            Tool(
                name="cpanel_email_list",
                description="List all email accounts for a cPanel user's domain",
                inputSchema={
                    "type": "object",
                    "properties": {
                        **ACCOUNT_PARAM,
                        "cpanel_user": {"type": "string", "description": "cPanel username"},
                        "domain": {"type": "string", "description": "Domain to list emails for"}
                    },
                    "required": ["account", "cpanel_user", "domain"]
                }
            ),
            Tool(
                name="cpanel_email_create",
                description="Create a new email account for a cPanel user",
                inputSchema={
                    "type": "object",
                    "properties": {
                        **ACCOUNT_PARAM,
                        "cpanel_user": {"type": "string"},
                        "email": {"type": "string", "description": "Full email address"},
                        "password": {"type": "string"},
                        "quota": {"type": "integer", "description": "Mailbox quota in MB (0 = unlimited)"}
                    },
                    "required": ["account", "cpanel_user", "email", "password"]
                }
            ),
            Tool(
                name="cpanel_forwarders_list",
                description="List all email forwarders for a cPanel user's domain",
                inputSchema={
                    "type": "object",
                    "properties": {
                        **ACCOUNT_PARAM,
                        "cpanel_user": {"type": "string"},
                        "domain": {"type": "string"}
                    },
                    "required": ["account", "cpanel_user", "domain"]
                }
            ),
            Tool(
                name="cpanel_dns_records",
                description="Get DNS zone records for a domain via cPanel UAPI",
                inputSchema={
                    "type": "object",
                    "properties": {
                        **ACCOUNT_PARAM,
                        "cpanel_user": {"type": "string"},
                        "domain": {"type": "string"}
                    },
                    "required": ["account", "cpanel_user", "domain"]
                }
            ),
            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"]
                }
            ),
            Tool(
                name="cpanel_disk_usage",
                description="Get disk usage breakdown for a specific cPanel account",
                inputSchema={
                    "type": "object",
                    "properties": {
                        **ACCOUNT_PARAM,
                        "cpanel_user": {"type": "string"}
                    },
                    "required": ["account", "cpanel_user"]
                }
            ),
            Tool(
                name="cpanel_ssl_check",
                description="Check SSL certificate status and expiry for a cPanel account's domains",
                inputSchema={
                    "type": "object",
                    "properties": {
                        **ACCOUNT_PARAM,
                        "cpanel_user": {"type": "string"}
                    },
                    "required": ["account", "cpanel_user"]
                }
            ),
            Tool(
                name="cpanel_cron_list",
                description="List all cron jobs configured for a cPanel account",
                inputSchema={
                    "type": "object",
                    "properties": {
                        **ACCOUNT_PARAM,
                        "cpanel_user": {"type": "string"}
                    },
                    "required": ["account", "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"]
                }
            ),
            Tool(
                name="cpanel_bandwidth_usage",
                description="Get bandwidth usage stats for a specific cPanel account",
                inputSchema={
                    "type": "object",
                    "properties": {
                        **ACCOUNT_PARAM,
                        "cpanel_user": {"type": "string"}
                    },
                    "required": ["account", "cpanel_user"]
                }
            ),
        ]
  • src/server.py:47-75 (registration)
    The call_tool handler in server.py dispatches tool names starting with 'whm_' to handle_whm_tool, which contains the whm_change_password case.
    @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))]
    
        account_alias = arguments.get("account")
        if not account_alias:
            return [TextContent(type="text", text="ERROR: 'account' parameter is required. Use list_accounts to see available accounts.")]
    
        account = get_account(account_alias)
        if not account:
            return [TextContent(type="text", text=f"ERROR: Account '{account_alias}' not found. Use list_accounts to see configured accounts.")]
    
        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))]
  • The _whm_url helper constructs the WHM API URL. For whm_change_password, it builds the URL to the 'passwd' API endpoint with 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"
Behavior2/5

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

No annotations provided, so description carries full burden. It only states the action without disclosing potential side effects, required permissions, or error conditions. The term 'change' implies mutation but lacks detail on destructive nature or reversibility.

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

Conciseness3/5

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

A single sentence with no fluff, but it is too minimal—lacks structure and context. While concise, it sacrifices useful information.

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?

Given no output schema and no annotations, the description should provide more context about the operation's behavior, such as success conditions, side effects, or relationship to other account management tools. It falls short.

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 33% (only 'account' has a description). The description does not add meaning for 'username' or 'password', and fails to compensate for the low coverage.

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 ('Change') and resource ('password for a cPanel account'). It distinguishes itself from sibling tools like whm_create_account or whm_terminate_account by focusing specifically on password changes.

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 (e.g., whm_create_account for initial password). No mention of prerequisites or when not to use it.

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