whmcs_get_tickets
Retrieve WHMCS support tickets with filtering options to manage and organize customer inquiries by department, client, status, or subject.
Instructions
Get support tickets with optional filtering
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limitstart | No | Starting offset | |
| limitnum | No | Number of results | |
| deptid | No | Filter by department ID | |
| clientid | No | Filter by client ID | |
| No | Filter by email | ||
| status | No | Filter by status | |
| subject | No | Filter by subject |
Implementation Reference
- src/whmcs-client.ts:614-649 (handler)Core handler implementation: WhmcsApiClient.getTickets method that makes the WHMCS API call to 'GetTickets' action with filtering parameters and returns paginated list of tickets.async getTickets(params: { limitstart?: number; limitnum?: number; deptid?: number; clientid?: number; email?: string; status?: string; subject?: string; ignore_dept_assignments?: boolean; } = {}) { return this.call<WhmcsApiResponse & { totalresults: number; startnumber: number; numreturned: number; tickets: { ticket: Array<{ id: number; tid: string; deptid: number; deptname: string; userid: number; name: string; email: string; cc: string; c: string; date: string; subject: string; status: string; priority: string; admin: string; attachment: string; lastreply: string; flag: number; service: string; }> }; }>('GetTickets', params); }
- src/index.ts:414-435 (registration)MCP tool registration for whmcs_get_tickets, including input schema validation with Zod and thin handler that delegates to WhmcsApiClient.getTickets and formats response as JSON text.server.registerTool( 'whmcs_get_tickets', { title: 'Get Tickets', description: 'Get support tickets with optional filtering', inputSchema: { limitstart: z.number().optional().describe('Starting offset'), limitnum: z.number().optional().describe('Number of results'), deptid: z.number().optional().describe('Filter by department ID'), clientid: z.number().optional().describe('Filter by client ID'), email: z.string().optional().describe('Filter by email'), status: z.string().optional().describe('Filter by status'), subject: z.string().optional().describe('Filter by subject'), }, }, async (params) => { const result = await whmcsClient.getTickets(params); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; } );
- src/index.ts:419-427 (schema)Input schema definition using Zod for parameter validation: pagination (limitstart, limitnum), filters (deptid, clientid, email, status, subject). Matches WHMCS GetTickets API parameters.inputSchema: { limitstart: z.number().optional().describe('Starting offset'), limitnum: z.number().optional().describe('Number of results'), deptid: z.number().optional().describe('Filter by department ID'), clientid: z.number().optional().describe('Filter by client ID'), email: z.string().optional().describe('Filter by email'), status: z.string().optional().describe('Filter by status'), subject: z.string().optional().describe('Filter by subject'), },