whmcs_get_support_statuses
Retrieve ticket statuses and their counts from WHMCS support system. Filter results by department ID to monitor support workflow and identify bottlenecks.
Instructions
Get ticket statuses with counts
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| deptid | No | Filter by department ID |
Implementation Reference
- src/index.ts:568-582 (registration)Registration of the 'whmcs_get_support_statuses' tool in the MCP server, including input schema (deptid optional), title, description, and thin async handler that delegates to WhmcsApiClient.getSupportStatuses and formats the JSON response.'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) }], }; } );
- src/whmcs-client.ts:791-803 (handler)Core handler implementation in WhmcsApiClient: getSupportStatuses method that performs the actual WHMCS API call to action='GetSupportStatuses' with optional deptid parameter, returning statuses array with title, count, and color./** * Get ticket statuses */ async getSupportStatuses(params: { deptid?: number } = {}) { return this.call<WhmcsApiResponse & { totalresults: number; statuses: { status: Array<{ title: string; count: number; color: string; }> }; }>('GetSupportStatuses', params); }
- src/index.ts:572-574 (schema)Input schema definition for the tool using Zod: optional deptid (number) to filter statuses by department.inputSchema: { deptid: z.number().optional().describe('Filter by department ID'), },
- src/index.ts:1862-1888 (helper)Related MCP resource 'whmcs-ticket-statuses' at whmcs://support/statuses that uses getSupportStatuses to provide ticket statuses as a JSON resource.'whmcs-ticket-statuses', 'whmcs://support/statuses', { title: 'Ticket Statuses', description: 'Available support ticket statuses', mimeType: 'application/json', }, async (uri) => { try { const statuses = await whmcsClient.getSupportStatuses({}); return { contents: [{ uri: uri.href, mimeType: 'application/json', text: JSON.stringify(statuses, null, 2), }], }; } catch (error) { return { contents: [{ uri: uri.href, mimeType: 'application/json', text: JSON.stringify({ error: 'Failed to fetch ticket statuses' }), }], }; } }