Skip to main content
Glama

Get Affiliates

whmcs_get_affiliates

Retrieve a paginated list of affiliates from your WHMCS installation. Use limit parameters to control results and offset.

Instructions

Get list of affiliates

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitstartNoStarting offset
limitnumNoNumber of results

Implementation Reference

  • src/index.ts:1165-1181 (registration)
    Registration of the 'whmcs_get_affiliates' MCP tool with schema definition and handler that delegates to whmcsClient.getAffiliates()
    server.registerTool(
        'whmcs_get_affiliates',
        {
            title: 'Get Affiliates',
            description: 'Get list of affiliates',
            inputSchema: {
                limitstart: z.number().optional().describe('Starting offset'),
                limitnum: z.number().optional().describe('Number of results'),
            },
        },
        async (params) => {
            const result = await whmcsClient.getAffiliates(params);
            return {
                content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
            };
        }
    );
  • Handler implementation - the getAffiliates method on WhmcsApiClient that makes the actual WHMCS API call with action 'GetAffiliates' and returns typed response
    async getAffiliates(params: {
        limitstart?: number;
        limitnum?: number;
    } = {}) {
        return this.call<WhmcsApiResponse & {
            totalresults: number;
            startnumber: number;
            numreturned: number;
            affiliates: { affiliate: Array<{
                id: number;
                userid: number;
                date: string;
                visitors: number;
                paytype: string;
                payamount: string;
                onetime: string;
                balance: string;
                withdrawn: string;
            }> };
        }>('GetAffiliates', params);
    }
  • Input schema for the whmcs_get_affiliates tool - accepts optional limitstart and limitnum parameters
    inputSchema: {
        limitstart: z.number().optional().describe('Starting offset'),
        limitnum: z.number().optional().describe('Number of results'),
    },
Behavior2/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It only says 'Get list of affiliates' which implies a read operation but omits any details about pagination behavior, default limits, ordering, permission requirements, or what fields are returned. This is insufficient for a safe and informed tool invocation.

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 extremely concise (just 4 words), which is efficient but comes at the cost of missing important context. While brevity is valued, the description sacrifices usability by not including any usage nuance or behavioral hints that would justify such brevity.

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 lack of output schema and annotations, the description must provide richer context about what 'affiliates' entails, such as the structure of each affiliate record, if there is any default limit or ordering. The current minimal description leaves the AI agent with insufficient information to understand the tool's complete behavior.

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 covers 100% of parameters with descriptions for 'limitstart' and 'limitnum', so the schema already provides parameter semantics. The description adds no additional meaning beyond confirming the list-retrieval nature. A score of 3 is appropriate as the schema handles the burden.

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 'Get list of affiliates' clearly states the verb and resource, making the basic purpose understandable. However, it does not differentiate from many other 'get' tools (e.g., whmcs_get_clients, whmcs_get_orders) that also retrieve lists, so it lacks sibling distinction.

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 like whmcs_get_clients or whmcs_get_activity_log. There is no mention of prerequisites, filtering capabilities, or context that would help an AI agent decide between siblings.

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