Skip to main content
Glama

whm_restart_service

Restart WHM services such as Apache, MySQL, or Exim by providing the account alias and service name.

Instructions

Restart a specific service on the WHM server (apache, mysql, exim, etc.)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accountYesAccount alias from accounts.json (use list_accounts to see options)
serviceYesService name: apache, mysql, exim, ftp, cpsrvd

Implementation Reference

  • Tool registration/definition for 'whm_restart_service' with input schema requiring 'account' and 'service' (apache, mysql, exim, ftp, cpsrvd) parameters.
    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"]
        }
    ),
  • Handler implementation for 'whm_restart_service' — maps friendly service names (apache->httpd, etc.) to WHM API service names and calls the 'restartservice' WHM JSON API endpoint.
    case "whm_restart_service":
        service_map = {
            "apache": "httpd",
            "mysql": "mysql",
            "exim": "exim",
            "ftp": "ftpd",
            "cpsrvd": "cpsrvd"
        }
        svc = service_map.get(args["service"].lower(), args["service"])
        return await _get(client, url("restartservice"), headers, {"service": svc})
  • src/server.py:21-22 (registration)
    Imports handle_whm_tool (which contains the handler) from tools module.
        handle_whm_tool, handle_cpanel_tool
    )
  • src/server.py:67-69 (registration)
    Registration: calls handle_whm_tool when a tool name starting with 'whm_' is invoked, routing 'whm_restart_service' to the correct handler.
    async with httpx.AsyncClient(verify=False, timeout=30) as client:
        if name.startswith("whm_"):
            result = await handle_whm_tool(client, account, name, arguments)
  • src/server.py:42-44 (registration)
    Registration: whm_tools() is called to register all WHM tool definitions (including whm_restart_service) with the MCP server.
    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?

No annotations are provided, so the description carries full burden. It discloses the restart action but lacks details on effects (e.g., service downtime, dependencies, permission requirements). For a disruptive operation, more transparency is expected.

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?

The description is a single, front-loaded sentence with no wasted words. It efficiently conveys the core action and scope.

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?

Given the simplicity of the tool (2 parameters, no output schema), the description provides the basic purpose. However, for a restart operation, additional context about consequences or usage notes would improve completeness.

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 description coverage is 100% (both parameters described). The description adds minimal value beyond listing example services, which already appears in the schema. Baseline 3 applies.

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 (restart), the resource (specific service on WHM server), and provides examples (apache, mysql, exim). It is distinct from sibling tools like whm_suspend_account or whm_server_info.

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 usage by listing example services but does not provide explicit guidance on when to use this tool versus alternatives, nor does it state when not to use it. No exclusions or prerequisites are mentioned.

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