Skip to main content
Glama

whmcs_get_clients

Retrieve client lists from WHMCS with filtering, sorting, and pagination options for efficient management.

Instructions

Get a list of clients from WHMCS with optional filtering and pagination

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitstartNoStarting offset for results (default 0)
limitnumNoNumber of results to return (default 25)
sortingNoSort order
statusNoFilter by status (Active, Inactive, Closed)
searchNoSearch term to filter clients
orderbyNoField to order by

Implementation Reference

  • Handler function that executes the tool: calls whmcsClient.getClients(params) and returns formatted JSON response.
    async (params) => { const result = await whmcsClient.getClients(params); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; }
  • Input schema using Zod for tool parameters: pagination, sorting, filtering by status/search/order.
    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/index.ts:49-69 (registration)
    MCP tool registration via server.registerTool including name, metadata, schema, and handler.
    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) }], }; } );
  • WhmcsApiClient.getClients method: performs the actual WHMCS 'GetClients' API call via this.call and type-defines response.
    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); }

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-server'

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