Skip to main content
Glama

Get Activity Log

whmcs_get_activity_log

Retrieve system activity logs from your WHMCS installation with filters for user, date, description, IP, and pagination to monitor and audit actions.

Instructions

Get system activity log

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitstartNoStarting offset
limitnumNoNumber of results
useridNoFilter by user ID
dateNoFilter by date
userNoFilter by user
descriptionNoFilter by description
ipaddressNoFilter by IP address

Implementation Reference

  • src/index.ts:1062-1083 (registration)
    Tool registration for 'whmcs_get_activity_log' with input schema and handler that calls whmcsClient.getActivityLog()
    server.registerTool(
        'whmcs_get_activity_log',
        {
            title: 'Get Activity Log',
            description: 'Get system activity log',
            inputSchema: {
                limitstart: z.number().optional().describe('Starting offset'),
                limitnum: z.number().optional().describe('Number of results'),
                userid: z.number().optional().describe('Filter by user ID'),
                date: z.string().optional().describe('Filter by date'),
                user: z.string().optional().describe('Filter by user'),
                description: z.string().optional().describe('Filter by description'),
                ipaddress: z.string().optional().describe('Filter by IP address'),
            },
        },
        async (params) => {
            const result = await whmcsClient.getActivityLog(params);
            return {
                content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
            };
        }
    );
  • Input schema definition for whmcs_get_activity_log tool with optional filtering parameters
    {
        title: 'Get Activity Log',
        description: 'Get system activity log',
        inputSchema: {
            limitstart: z.number().optional().describe('Starting offset'),
            limitnum: z.number().optional().describe('Number of results'),
            userid: z.number().optional().describe('Filter by user ID'),
            date: z.string().optional().describe('Filter by date'),
            user: z.string().optional().describe('Filter by user'),
            description: z.string().optional().describe('Filter by description'),
            ipaddress: z.string().optional().describe('Filter by IP address'),
        },
    },
  • The getActivityLog method on WhmcsApiClient that calls the WHMCS 'GetActivityLog' API action with typed parameters and response type
    /**
     * Get activity log
     */
    async getActivityLog(params: {
        limitstart?: number;
        limitnum?: number;
        userid?: number;
        date?: string;
        user?: string;
        description?: string;
        ipaddress?: string;
    } = {}) {
        return this.call<WhmcsApiResponse & {
            totalresults: number;
            startnumber: number;
            numreturned: number;
            activity: { entry: Array<{
                id: number;
                date: string;
                user: string;
                description: string;
                ipaddress: string;
                userid: number;
            }> };
        }>('GetActivityLog', params);
    }
  • Helper method flattenParams used to convert nested parameters into URL-encoded format for API requests
    private flattenParams(params: Record<string, unknown>, prefix = ''): Record<string, string> {
        const result: Record<string, string> = {};
        
        for (const [key, value] of Object.entries(params)) {
            const newKey = prefix ? `${prefix}[${key}]` : key;
            
            if (value === null || value === undefined) {
                continue;
            } else if (typeof value === 'object' && !Array.isArray(value)) {
                Object.assign(result, this.flattenParams(value as Record<string, unknown>, newKey));
            } else if (Array.isArray(value)) {
                value.forEach((item, index) => {
                    if (typeof item === 'object') {
                        Object.assign(result, this.flattenParams(item as Record<string, unknown>, `${newKey}[${index}]`));
                    } else {
                        result[`${newKey}[${index}]`] = String(item);
                    }
                });
            } else {
                result[newKey] = String(value);
            }
        }
        
        return result;
    }
  • Generic API call helper that sends requests to the WHMCS API endpoint, used by getActivityLog to invoke 'GetActivityLog' action
    async call<T extends WhmcsApiResponse>(action: string, params: Record<string, unknown> = {}): Promise<T> {
        const url = `${this.config.apiUrl.replace(/\/$/, '')}/includes/api.php`;
        
        const postData: Record<string, string> = {
            identifier: this.config.apiIdentifier,
            secret: this.config.apiSecret,
            action: action,
            responsetype: 'json',
            ...this.flattenParams(params)
        };
    
        if (this.config.accessKey) {
            postData.accesskey = this.config.accessKey;
        }
    
        const response = await fetch(url, {
            method: 'POST',
            headers: {
                'Content-Type': 'application/x-www-form-urlencoded',
            },
            body: new URLSearchParams(postData).toString(),
        });
    
        if (!response.ok) {
            throw new Error(`WHMCS API request failed: ${response.status} ${response.statusText}`);
        }
    
        const data = await response.json() as T;
        
        if (data.result === 'error') {
            throw new Error(`WHMCS API error: ${data.message || 'Unknown error'}`);
        }
    
        return data;
    }
Behavior2/5

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

No annotations are provided, so the description bears full responsibility. It only says 'Get system activity log' without disclosing side effects, permissions needed, or any behavioral traits beyond the implied read-only nature.

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 (4 words), which is positive, but it lacks substance and fails to convey important details. It is adequate but not optimally helpful.

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?

With no output schema and many optional filter parameters, the description is insufficient. It does not explain the log contents, filter behavior, or return structure, making the tool incomplete for an 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?

Schema description coverage is 100% with all 7 parameters described in the input schema. The tool description does not add any additional meaning beyond what the schema already provides, so it meets the baseline of 3.

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

Purpose3/5

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

The description states 'Get system activity log', which is a verb+noun pair indicating the action and resource. However, it does not distinguish this tool from similar siblings like whmcs_get_tickets or whmcs_get_invoices, lacking specificity about what constitutes an 'activity log'.

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?

There is no guidance on when to use this tool versus alternatives. The description merely states the action without any context about appropriate scenarios or prerequisites.

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