Skip to main content
Glama

cpanel_email_create

Create a new email account for a cPanel user by specifying email address, password, and mailbox quota.

Instructions

Create a new email account for a cPanel user

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accountYesAccount alias from accounts.json (use list_accounts to see options)
cpanel_userYes
emailYesFull email address
passwordYes
quotaNoMailbox quota in MB (0 = unlimited)

Implementation Reference

  • Input schema definition for cpanel_email_create tool, specifying required params: account, cpanel_user, email, password, and optional quota.
    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"]
        }
    ),
  • Handler for cpanel_email_create: splits email into local part and domain, then calls UAPI Email::add_pop to create the email account with password and quota.
    case "cpanel_email_create":
        email_parts = args["email"].split("@")
        return await _get(client, url("Email", "add_pop"), headers, {
            "email": email_parts[0],
            "domain": email_parts[1] if len(email_parts) > 1 else "",
            "password": args["password"],
            "quota": args.get("quota", 0)
        })
  • src/server.py:47-75 (registration)
    The cpanel_email_create tool is dispatched via handle_cpanel_tool when a tool name starting with 'cpanel_' is called, as registered in the MCP server's call_tool handler.
    @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))]
  • src/server.py:43-43 (registration)
    cpanel_tools() (which includes cpanel_email_create) is registered into the MCP server's tool list via list_tools().
    all_tools.extend(cpanel_tools())
  • Helper that builds the WHM-proxied UAPI URL for cPanel operations like Email::add_pop used by cpanel_email_create.
    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"
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure, but it only states 'Create a new email account'. It fails to mention effects like modifying cPanel settings, required permissions, or success/failure behavior. No output schema is provided to compensate.

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, front-loaded sentence of 10 words, which is highly concise and free of fluff. However, it sacrifices necessary detail for brevity, earning a slightly lower score.

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 the tool has 5 parameters, no output schema, and no annotations, the description is insufficient. It omits return values, error scenarios, prerequisites, and post-creation state, leaving the agent without critical information for correct invocation.

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?

The input schema has 60% description coverage (3 of 5 parameters have descriptions). The tool description itself adds no extra meaning to parameters; it simply repeats the creation intent. Two parameters (cpanel_user, password) lack schema descriptions and are not explained in the description, leaving gaps for the agent.

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 'Create a new email account for a cPanel user', which uses a specific verb (create) and resource (email account). It distinguishes itself from sibling tools like cpanel_email_list (list) and cpanel_forwarders_list (forwarders), making its purpose unambiguous.

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?

The description provides no guidance on when to use this tool versus alternatives, nor does it mention prerequisites or conditions. For example, it doesn't clarify that the cPanel user must already exist or that the email address must be unique.

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