Skip to main content
Glama

whmcs_get_client_products

Retrieve products and services owned by a WHMCS client using filters like client ID, domain, or product ID.

Instructions

Get products/services owned by a client

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
clientidNoThe client ID
serviceidNoSpecific service ID
domainNoFilter by domain
pidNoFilter by product ID
limitstartNoStarting offset
limitnumNoNumber of results

Implementation Reference

  • The async handler function registered for the tool. It invokes whmcsClient.getClientProducts with input params and returns the JSON-formatted result as MCP content.
        const result = await whmcsClient.getClientProducts(params);
        return {
            content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
        };
    }
  • Zod-based input schema defining optional parameters for filtering and pagination when retrieving client products.
        clientid: z.number().optional().describe('The client ID'),
        serviceid: z.number().optional().describe('Specific service ID'),
        domain: z.string().optional().describe('Filter by domain'),
        pid: z.number().optional().describe('Filter by product ID'),
        limitstart: z.number().optional().describe('Starting offset'),
        limitnum: z.number().optional().describe('Number of results'),
    },
  • src/index.ts:174-194 (registration)
    Full registration of the 'whmcs_get_client_products' MCP tool using McpServer.registerTool method, including title, description, input schema, and handler.
        'whmcs_get_client_products',
        {
            title: 'Get Client Products',
            description: 'Get products/services owned by a client',
            inputSchema: {
                clientid: z.number().optional().describe('The client ID'),
                serviceid: z.number().optional().describe('Specific service ID'),
                domain: z.string().optional().describe('Filter by domain'),
                pid: z.number().optional().describe('Filter by product ID'),
                limitstart: z.number().optional().describe('Starting offset'),
                limitnum: z.number().optional().describe('Number of results'),
            },
        },
        async (params) => {
            const result = await whmcsClient.getClientProducts(params);
            return {
                content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
            };
        }
    );
  • WhmcsApiClient.getClientProducts helper method that performs the actual WHMCS API call to action 'GetClientsProducts' with typed response handling and parameter flattening.
    async getClientProducts(params: {
        clientid?: number;
        serviceid?: number;
        domain?: string;
        pid?: number;
        username2?: string;
        limitstart?: number;
        limitnum?: number;
    } = {}) {
        return this.call<WhmcsApiResponse & {
            totalresults: number;
            startnumber: number;
            numreturned: number;
            products: { product: Array<{
                id: number;
                clientid: number;
                orderid: number;
                pid: number;
                regdate: string;
                name: string;
                translated_name: string;
                groupname: string;
                translated_groupname: string;
                domain: string;
                dedicatedip: string;
                serverid: number;
                servername: string;
                serverip: string;
                serverhostname: string;
                suspensionreason: string;
                firstpaymentamount: string;
                recurringamount: string;
                paymentmethod: string;
                paymentmethodname: string;
                billingcycle: string;
                nextduedate: string;
                status: string;
                username: string;
                password: string;
                subscriptionid: string;
                promoid: number;
                overideautosuspend: string;
                overidesuspenduntil: string;
                ns1: string;
                ns2: string;
                assignedips: string;
                notes: string;
                diskusage: number;
                disklimit: number;
                bwusage: number;
                bwlimit: number;
                lastupdate: string;
            }> };
        }>('GetClientsProducts', 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