Skip to main content
Glama

Get Transactions

whmcs_get_transactions

Retrieve payment transactions with optional filters by invoice ID, client ID, or transaction ID.

Instructions

Get payment transactions

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
invoiceidNoFilter by invoice ID
clientidNoFilter by client ID
transidNoFilter by transaction ID

Implementation Reference

  • src/index.ts:391-408 (registration)
    Registers the 'whmcs_get_transactions' tool on the MCP server with its input schema (invoiceid, clientid, transid) and a handler that delegates to whmcsClient.getTransactions()
    server.registerTool(
        'whmcs_get_transactions',
        {
            title: 'Get Transactions',
            description: 'Get payment transactions',
            inputSchema: {
                invoiceid: z.number().optional().describe('Filter by invoice ID'),
                clientid: z.number().optional().describe('Filter by client ID'),
                transid: z.string().optional().describe('Filter by transaction ID'),
            },
        },
        async (params) => {
            const result = await whmcsClient.getTransactions(params);
            return {
                content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
            };
        }
    );
  • Input schema for whmcs_get_transactions tool: optional filters by invoiceid (number), clientid (number), and transid (string)
    inputSchema: {
        invoiceid: z.number().optional().describe('Filter by invoice ID'),
        clientid: z.number().optional().describe('Filter by client ID'),
        transid: z.string().optional().describe('Filter by transaction ID'),
    },
  • Handler function for whmcs_get_transactions - calls whmcsClient.getTransactions(params) and returns the result as JSON text content
    async (params) => {
        const result = await whmcsClient.getTransactions(params);
        return {
            content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
        };
    }
  • Helper method on WhmcsApiClient - calls the WHMCS 'GetTransactions' API action, returns typed response with transaction details including id, userid, gateway, date, amounts, and transid
    async getTransactions(params: {
        invoiceid?: number;
        clientid?: number;
        transid?: string;
    } = {}) {
        return this.call<WhmcsApiResponse & {
            totalresults: number;
            startnumber: number;
            numreturned: number;
            transactions: { transaction: Array<{
                id: number;
                userid: number;
                currency: number;
                gateway: string;
                date: string;
                description: string;
                amountin: string;
                amountout: string;
                rate: string;
                transid: string;
                invoiceid: number;
                refundid: number;
            }> };
        }>('GetTransactions', params);
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It only says 'Get payment transactions' with no mention of read-only nature, rate limits, pagination, or result limits. This minimal information does not satisfy transparency needs.

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

Conciseness3/5

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

The description is very short (one phrase) and lacks necessary details such as scope or behavior. While concise, it is under-specified and does not earn its brevity with adequate informativeness. It could be slightly expanded without losing conciseness.

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 no output schema and no annotations, the description must compensate by explaining return values, default behavior when no filters are applied (e.g., returns all transactions?), and any constraints. It fails to do so, leaving significant gaps for an AI agent.

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?

The input schema has 100% description coverage, with all three parameters clearly documented inline (invoiceid, clientid, transid). The tool description adds no additional meaning beyond the schema, so a baseline score of 3 is appropriate.

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 states 'Get payment transactions', clearly indicating the verb and resource. However, it does not differentiate from sibling tools like whmcs_get_invoices or whmcs_get_orders, which might also involve payment data. The purpose is clear but lacks specificity for distinguishing among many similar get operations.

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 usage guidance is provided. The description does not indicate when to use this tool versus alternatives like whmcs_get_invoices, nor does it mention prerequisites or scenarios. The agent must infer usage solely from the tool name.

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