Get Affiliates
whmcs_get_affiliatesRetrieve a paginated list of affiliates from your WHMCS installation. Use limit parameters to control results and offset.
Instructions
Get list of affiliates
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limitstart | No | Starting offset | |
| limitnum | No | Number of results |
Implementation Reference
- src/index.ts:1165-1181 (registration)Registration of the 'whmcs_get_affiliates' MCP tool with schema definition and handler that delegates to whmcsClient.getAffiliates()
server.registerTool( 'whmcs_get_affiliates', { title: 'Get Affiliates', description: 'Get list of affiliates', inputSchema: { limitstart: z.number().optional().describe('Starting offset'), limitnum: z.number().optional().describe('Number of results'), }, }, async (params) => { const result = await whmcsClient.getAffiliates(params); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; } ); - src/whmcs-client.ts:1348-1368 (handler)Handler implementation - the getAffiliates method on WhmcsApiClient that makes the actual WHMCS API call with action 'GetAffiliates' and returns typed response
async getAffiliates(params: { limitstart?: number; limitnum?: number; } = {}) { return this.call<WhmcsApiResponse & { totalresults: number; startnumber: number; numreturned: number; affiliates: { affiliate: Array<{ id: number; userid: number; date: string; visitors: number; paytype: string; payamount: string; onetime: string; balance: string; withdrawn: string; }> }; }>('GetAffiliates', params); } - src/index.ts:1170-1173 (schema)Input schema for the whmcs_get_affiliates tool - accepts optional limitstart and limitnum parameters
inputSchema: { limitstart: z.number().optional().describe('Starting offset'), limitnum: z.number().optional().describe('Number of results'), },