Get Clients
whmcs_get_clientsRetrieve a filtered, paginated list of WHMCS clients by status, search term, or sorting order.
Instructions
Get a list of clients from WHMCS with optional filtering and pagination
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limitstart | No | Starting offset for results (default 0) | |
| limitnum | No | Number of results to return (default 25) | |
| sorting | No | Sort order | |
| status | No | Filter by status (Active, Inactive, Closed) | |
| search | No | Search term to filter clients | |
| orderby | No | Field to order by |
Implementation Reference
- src/index.ts:49-69 (registration)Registration of the 'whmcs_get_clients' tool via server.registerTool(), with input schema (limitstart, limitnum, sorting, status, search, orderby) and handler that delegates to whmcsClient.getClients()
server.registerTool( 'whmcs_get_clients', { title: 'Get Clients', description: 'Get a list of clients from WHMCS with optional filtering and pagination', inputSchema: { limitstart: z.number().optional().describe('Starting offset for results (default 0)'), limitnum: z.number().optional().describe('Number of results to return (default 25)'), sorting: z.enum(['ASC', 'DESC']).optional().describe('Sort order'), status: z.string().optional().describe('Filter by status (Active, Inactive, Closed)'), search: z.string().optional().describe('Search term to filter clients'), orderby: z.string().optional().describe('Field to order by'), }, }, async (params) => { const result = await whmcsClient.getClients(params); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; } ); - src/index.ts:63-68 (handler)Handler function for whmcs_get_clients - calls whmcsClient.getClients(params) and formats JSON response
async (params) => { const result = await whmcsClient.getClients(params); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; } - src/index.ts:54-61 (schema)Input schema definitions for whmcs_get_clients using Zod with optional parameters: limitstart, limitnum, sorting (ASC/DESC), status, search, orderby
inputSchema: { limitstart: z.number().optional().describe('Starting offset for results (default 0)'), limitnum: z.number().optional().describe('Number of results to return (default 25)'), sorting: z.enum(['ASC', 'DESC']).optional().describe('Sort order'), status: z.string().optional().describe('Filter by status (Active, Inactive, Closed)'), search: z.string().optional().describe('Search term to filter clients'), orderby: z.string().optional().describe('Field to order by'), }, - src/whmcs-client.ts:101-124 (helper)WhmcsApiClient.getClients() method - the actual API call implementation sending 'GetClients' action to WHMCS API with typed response including client array
async getClients(params: { limitstart?: number; limitnum?: number; sorting?: 'ASC' | 'DESC'; status?: string; search?: string; orderby?: string; } = {}) { return this.call<WhmcsApiResponse & { totalresults: number; startnumber: number; numreturned: number; clients: { client: Array<{ id: number; firstname: string; lastname: string; companyname: string; email: string; datecreated: string; groupid: number; status: string; }> }; }>('GetClients', params); }