Get Product Groups
whmcs_get_product_groupsRetrieves all product groups from WHMCS to list available categories for further operations.
Instructions
Get all product groups from WHMCS
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:246-252 (handler)The handler function that executes the 'whmcs_get_product_groups' tool logic. It calls whmcsClient.getProductGroups() and returns the JSON result.
async () => { const result = await whmcsClient.getProductGroups(); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; } ); - src/index.ts:240-244 (schema)Input schema for the tool. It defines 'whmcs_get_product_groups' with an empty input schema (no parameters required).
'whmcs_get_product_groups', { title: 'Get Product Groups', description: 'Get all product groups from WHMCS', inputSchema: {}, - src/index.ts:239-252 (registration)Registration of the 'whmcs_get_product_groups' tool via server.registerTool() with name, metadata, and handler.
server.registerTool( 'whmcs_get_product_groups', { title: 'Get Product Groups', description: 'Get all product groups from WHMCS', inputSchema: {}, }, async () => { const result = await whmcsClient.getProductGroups(); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; } ); - src/whmcs-client.ts:387-401 (helper)The getProductGroups() method on WhmcsApiClient that calls the WHMCS API 'GetProductGroups' action and returns the typed response with product groups data.
/** * Get product groups */ async getProductGroups() { return this.call<WhmcsApiResponse & { totalresults: number; productgroups: { productgroup: Array<{ id: number; name: string; headline: string; tagline: string; orderfrmtpl: string; }> }; }>('GetProductGroups'); }