Skip to main content
Glama

Get Products

whmcs_get_products

Get a list of WHMCS products and services, with optional filters for product ID, group ID, or server module.

Instructions

Get available products/services from WHMCS

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pidNoSpecific product ID
gidNoFilter by product group ID
moduleNoFilter by server module

Implementation Reference

  • src/index.ts:220-237 (registration)
    Registration of the 'whmcs_get_products' tool with the MCP server. Defines the tool name, schema (pid, gid, module params), and the handler that delegates to whmcsClient.getProducts().
    server.registerTool(
        'whmcs_get_products',
        {
            title: 'Get Products',
            description: 'Get available products/services from WHMCS',
            inputSchema: {
                pid: z.number().optional().describe('Specific product ID'),
                gid: z.number().optional().describe('Filter by product group ID'),
                module: z.string().optional().describe('Filter by server module'),
            },
        },
        async (params) => {
            const result = await whmcsClient.getProducts(params);
            return {
                content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
            };
        }
    );
  • Actual handler implementation: getProducts() method on the WhmcsApiClient class. Calls the WHMCS API 'GetProducts' action with optional pid, gid, module params, returning typed product data with pricing info.
    async getProducts(params: {
        pid?: number;
        gid?: number;
        module?: string;
    } = {}) {
        return this.call<WhmcsApiResponse & {
            totalresults: number;
            startnumber: number;
            numreturned: number;
            products: { product: Array<{
                pid: number;
                gid: number;
                type: string;
                name: string;
                description: string;
                module: string;
                paytype: string;
                pricing: Record<string, {
                    prefix: string;
                    suffix: string;
                    msetupfee: string;
                    qsetupfee: string;
                    ssetupfee: string;
                    asetupfee: string;
                    bsetupfee: string;
                    tsetupfee: string;
                    monthly: string;
                    quarterly: string;
                    semiannually: string;
                    annually: string;
                    biennially: string;
                    triennially: string;
                }>;
            }> };
        }>('GetProducts', params);
    }
  • Input schema definition for the whmcs_get_products tool, specifying optional parameters: pid (product ID), gid (group ID), and module (server module filter).
    inputSchema: {
        pid: z.number().optional().describe('Specific product ID'),
        gid: z.number().optional().describe('Filter by product group ID'),
        module: z.string().optional().describe('Filter by server module'),
  • TypeScript parameter type definition for the getProducts method, matching the Zod schema.
    async getProducts(params: {
        pid?: number;
        gid?: number;
        module?: string;
    } = {}) {
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description bears full responsibility for disclosing behavioral traits. It only states the tool's purpose, omitting critical details such as read-only nature, authentication requirements, pagination, or error handling.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence with no redundant information. It is concise, though it could benefit from a slightly more structured format (e.g., listing key parameters).

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the absence of an output schema and only optional parameters, the description does not convey the tool's scope, return format, or how filtering works. The agent lacks sufficient context to interpret results correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

All three parameters are fully described in the input schema (100% coverage). The description adds no additional meaning beyond the schema, which is adequate but not enhancing.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a clear verb ('Get') and resource ('products/services'), making the tool's purpose evident. It is distinguishable from sibling get tools by specifically mentioning products, but lacks explicit differentiation from similar tools like 'whmcs_get_client_products'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives (e.g., whmcs_get_product_groups, whmcs_get_client_products). The agent must rely solely on the name and context, which may lead to incorrect selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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

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