Skip to main content
Glama

Get Orders

whmcs_get_orders

Retrieve orders from WHMCS with optional filters by ID, client, status, or pagination.

Instructions

Get orders with optional filtering

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitstartNoStarting offset
limitnumNoNumber of results
idNoSpecific order ID
useridNoFilter by client ID
statusNoFilter by status

Implementation Reference

  • src/index.ts:771-790 (registration)
    Registration of the 'whmcs_get_orders' tool via server.registerTool with input schema (limitstart, limitnum, id, userid, status) and handler that delegates to whmcsClient.getOrders()
    server.registerTool(
        'whmcs_get_orders',
        {
            title: 'Get Orders',
            description: 'Get orders with optional filtering',
            inputSchema: {
                limitstart: z.number().optional().describe('Starting offset'),
                limitnum: z.number().optional().describe('Number of results'),
                id: z.number().optional().describe('Specific order ID'),
                userid: z.number().optional().describe('Filter by client ID'),
                status: z.string().optional().describe('Filter by status'),
            },
        },
        async (params) => {
            const result = await whmcsClient.getOrders(params);
            return {
                content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
            };
        }
    );
  • The async handler function for whmcs_get_orders that calls whmcsClient.getOrders(params) and returns the JSON-stringified result
        async (params) => {
            const result = await whmcsClient.getOrders(params);
            return {
                content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
            };
        }
    );
  • Input schema (Zod) for whmcs_get_orders: limitstart (number optional), limitnum (number optional), id (number optional), userid (number optional), status (string optional)
        inputSchema: {
            limitstart: z.number().optional().describe('Starting offset'),
            limitnum: z.number().optional().describe('Number of results'),
            id: z.number().optional().describe('Specific order ID'),
            userid: z.number().optional().describe('Filter by client ID'),
            status: z.string().optional().describe('Filter by status'),
        },
    },
  • The WhmcsApiClient.getOrders() helper method that sends the 'GetOrders' action to the WHMCS API with typed parameters and response
    /**
     * Get orders
     */
    async getOrders(params: {
        limitstart?: number;
        limitnum?: number;
        id?: number;
        userid?: number;
        status?: string;
    } = {}) {
        return this.call<WhmcsApiResponse & {
            totalresults: number;
            startnumber: number;
            numreturned: number;
            orders: { order: Array<{
                id: number;
                ordernum: string;
                userid: number;
                contactid: number;
                requestor_id: number;
                date: string;
                nameservers: string;
                transfersecret: string;
                renewals: string;
                promocode: string;
                promotype: string;
                promovalue: string;
                orderdata: string;
                amount: string;
                paymentmethod: string;
                invoiceid: number;
                status: string;
                ipaddress: string;
                fraudmodule: string;
                fraudoutput: string;
                notes: string;
                paymentmethodname: string;
                paymentstatus: string;
                lineitems: { lineitem: Array<{
                    type: string;
                    relid: number;
                    producttype: string;
                    product: string;
                    domain: string;
                    billingcycle: string;
                    amount: string;
                    status: string;
                }> };
            }> };
        }>('GetOrders', params);
    }
Behavior2/5

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

No annotations exist, so the description must disclose behavioral traits. It only mentions 'optional filtering' but does not explain pagination behavior (limitstart, limitnum), what is returned for empty queries, or whether it returns all orders by default. Minimal transparency.

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?

Single sentence, front-loaded with the verb and resource. Could be slightly more informative (e.g., mention pagination or status), but no wasted words.

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?

No output schema, no annotations, and minimal description. For a tool with 5 optional parameters and many sibling tools, more context (e.g., typical use case, filter options) is needed for an agent to use it effectively.

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?

Schema coverage is 100%, and the description adds no new meaning beyond the schema's parameter descriptions. Baseline 3 is appropriate.

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

Purpose5/5

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

The description clearly states the action ('Get orders') and the resource ('orders') with optional filtering, distinguishing it from sibling tools like whmcs_accept_order or whmcs_cancel_order.

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 on when to use this tool versus alternatives (e.g., whmcs_get_invoices for invoices, or whmcs_get_client_products for products). No mention of prerequisites or when not to use.

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