whmcs_get_todo_items
Retrieve admin to-do items from WHMCS with options to filter by status and paginate results for efficient task management.
Instructions
Get admin to-do items
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limitstart | No | Starting offset | |
| limitnum | No | Number of results | |
| status | No | Filter by status |
Implementation Reference
- src/whmcs-client.ts:1304-1326 (handler)The handler function `getToDoItems` in WhmcsApiClient class that performs the actual WHMCS API call to 'GetToDoItems' action, handling parameters and response typing.* Get to-do items */ async getToDoItems(params: { limitstart?: number; limitnum?: number; status?: 'Incomplete' | 'Complete' | 'Pending'; } = {}) { return this.call<WhmcsApiResponse & { totalresults: number; startnumber: number; numreturned: number; items: { item: Array<{ id: number; date: string; title: string; description: string; status: string; duedate: string; admin: number; adminname: string; }> }; }>('GetToDoItems', params); }
- src/index.ts:1124-1141 (registration)The MCP tool registration for 'whmcs_get_todo_items' including title, description, Zod input schema validation, and handler wrapper that delegates to WhmcsApiClient.'whmcs_get_todo_items', { title: 'Get To-Do Items', description: 'Get admin to-do items', inputSchema: { limitstart: z.number().optional().describe('Starting offset'), limitnum: z.number().optional().describe('Number of results'), status: z.enum(['Incomplete', 'Complete', 'Pending']).optional().describe('Filter by status'), }, }, async (params) => { const result = await whmcsClient.getToDoItems(params); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; } );
- src/index.ts:1129-1133 (schema)Zod input schema for the whmcs_get_todo_items tool defining optional parameters for pagination and status filtering.limitstart: z.number().optional().describe('Starting offset'), limitnum: z.number().optional().describe('Number of results'), status: z.enum(['Incomplete', 'Complete', 'Pending']).optional().describe('Filter by status'), }, },
- src/whmcs-client.ts:29-63 (helper)Generic `call` method in WhmcsApiClient that powers all API interactions, used by getToDoItems to make the actual HTTP request to WHMCS API.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; }