Skip to main content
Glama

Get Support Statuses

whmcs_get_support_statuses

Retrieve a list of support ticket statuses along with the count of tickets in each status. Optionally filter by department ID to narrow results.

Instructions

Get ticket statuses with counts

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
deptidNoFilter by department ID

Implementation Reference

  • src/index.ts:586-601 (registration)
    Registration of the 'whmcs_get_support_statuses' tool via server.registerTool(), with input schema accepting an optional deptid filter
    server.registerTool(
        'whmcs_get_support_statuses',
        {
            title: 'Get Support Statuses',
            description: 'Get ticket statuses with counts',
            inputSchema: {
                deptid: z.number().optional().describe('Filter by department ID'),
            },
        },
        async (params) => {
            const result = await whmcsClient.getSupportStatuses(params);
            return {
                content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
            };
        }
    );
  • Handler method getSupportStatuses() on WhmcsApiClient that calls the WHMCS API action 'GetSupportStatuses' and returns statuses with title, count, and color
    async getSupportStatuses(params: { deptid?: number } = {}) {
        return this.call<WhmcsApiResponse & {
            totalresults: number;
            statuses: { status: Array<{
                title: string;
                count: number;
                color: string;
            }> };
        }>('GetSupportStatuses', params);
    }
  • The generic call() method on WhmcsApiClient that performs the actual HTTP POST request to the WHMCS API
    async call<T extends WhmcsApiResponse>(action: string, params: Record<string, unknown> = {}): Promise<T> {
        const url = `${this.config.apiUrl.replace(/\/$/, '')}/includes/api.php`;
        
        const postData: Record<string, string> = {
            identifier: this.config.apiIdentifier,
            secret: this.config.apiSecret,
            action: action,
            responsetype: 'json',
            ...this.flattenParams(params)
        };
    
        if (this.config.accessKey) {
            postData.accesskey = this.config.accessKey;
        }
    
        const response = await fetch(url, {
            method: 'POST',
            headers: {
                'Content-Type': 'application/x-www-form-urlencoded',
            },
            body: new URLSearchParams(postData).toString(),
        });
    
        if (!response.ok) {
            throw new Error(`WHMCS API request failed: ${response.status} ${response.statusText}`);
        }
    
        const data = await response.json() as T;
        
        if (data.result === 'error') {
            throw new Error(`WHMCS API error: ${data.message || 'Unknown error'}`);
        }
    
        return data;
    }
Behavior2/5

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

No annotations provided, so the description carries full burden. It indicates a read operation but does not disclose behavioral traits such as authentication requirements, rate limits, or whether counts are filtered by deptid. The description is minimal.

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?

Single sentence, front-loaded with key information. No wasted words. However, it could be slightly more informative without losing conciseness.

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?

No output schema, so description should explain return values. It mentions 'with counts' but lacks structure details. For a simple tool with one optional parameter, it is minimally complete but could be improved.

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% for the single parameter (deptid). Description adds nothing beyond the schema, but the schema is sufficient. Baseline score of 3 is appropriate.

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 'Get ticket statuses with counts' clearly states the verb (get), resource (support statuses), and additional detail (with counts). It distinguishes from sibling tools like whmcs_get_tickets (which returns tickets) and whmcs_get_support_departments (which returns departments).

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?

No explicit guidance on when to use this tool versus alternatives (e.g., whmcs_get_tickets for individual tickets or whmcs_get_support_departments for department listing). Usage is implied but not clarified.

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/scarecr0w12/whmcs-mcp-tool'

If you have feedback or need assistance with the MCP directory API, please join our Discord server