Log Activity
whmcs_log_activityLog an activity entry to track user actions or system events in WHMCS. Provide a description and optionally associate a user ID.
Instructions
Add an entry to the activity log
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| description | Yes | Activity description | |
| userid | No | Associated user ID |
Implementation Reference
- src/index.ts:1085-1101 (registration)Registration of the 'whmcs_log_activity' tool with the MCP server, defining its name, description, input schema (description string, optional userid number), and handler that calls whmcsClient.logActivity().
server.registerTool( 'whmcs_log_activity', { title: 'Log Activity', description: 'Add an entry to the activity log', inputSchema: { description: z.string().describe('Activity description'), userid: z.number().optional().describe('Associated user ID'), }, }, async (params) => { const result = await whmcsClient.logActivity(params); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; } ); - src/index.ts:1095-1101 (handler)The inline handler (async callback) for the whmcs_log_activity tool. It receives params (description, userid), calls whmcsClient.logActivity(params), and returns the result as JSON text.
async (params) => { const result = await whmcsClient.logActivity(params); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; } ); - src/index.ts:1089-1094 (schema)Input schema for whmcs_log_activity: description (string, required) and userid (number, optional), defined using Zod.
description: 'Add an entry to the activity log', inputSchema: { description: z.string().describe('Activity description'), userid: z.number().optional().describe('Associated user ID'), }, }, - src/whmcs-client.ts:1306-1314 (helper)The logActivity method on WhmcsApiClient class. Accepts { description: string, userid?: number } parameters and calls the WHMCS API 'LogActivity' action via this.call().
/** * Log activity */ async logActivity(params: { description: string; userid?: number; }) { return this.call<WhmcsApiResponse>('LogActivity', params); }