whmcs_log_activity
Log user activities in WHMCS by adding entries to the system's activity log with descriptions and user IDs for tracking and auditing purposes.
Instructions
Add an entry to the activity log
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| description | Yes | Activity description | |
| userid | No | Associated user ID |
Implementation Reference
- src/index.ts:1067-1082 (registration)Registers the 'whmcs_log_activity' MCP tool, defining its input schema (description: string required, userid: number optional) and a thin handler wrapper that delegates to WhmcsApiClient.logActivity and formats the response as JSON text.'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/whmcs-client.ts:1296-1301 (handler)Core handler implementation in WhmcsApiClient that executes the WHMCS API 'LogActivity' action, logging the provided description (optionally associated with a user ID) to the WHMCS activity log.async logActivity(params: { description: string; userid?: number; }) { return this.call<WhmcsApiResponse>('LogActivity', params); }
- src/index.ts:1071-1075 (schema)Zod input schema validation for the whmcs_log_activity tool: requires 'description' string, optional 'userid' number.inputSchema: { description: z.string().describe('Activity description'), userid: z.number().optional().describe('Associated user ID'), }, },