get-list-actions
Retrieve all actions from a specific Trello list to track changes, monitor activity, and review updates for project management.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| listId | Yes | ID of the list to get actions for | |
| filter | No | Filter for action types |
Implementation Reference
- src/tools/lists.ts:285-326 (handler)The main handler function for the 'get-list-actions' tool. It fetches actions for the specified Trello list ID via the Trello API, supports optional filter, checks credentials, handles errors, and returns JSON data or error message.async ({ listId, filter }) => { try { if (!credentials.apiKey || !credentials.apiToken) { return { content: [ { type: 'text', text: 'Trello API credentials are not configured', }, ], isError: true, }; } const url = new URL(`https://api.trello.com/1/lists/${listId}/actions`); url.searchParams.append('key', credentials.apiKey); url.searchParams.append('token', credentials.apiToken); if (filter) url.searchParams.append('filter', filter); const response = await fetch(url.toString()); const data = await response.json(); return { content: [ { type: 'text', text: JSON.stringify(data), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error getting list actions: ${error}`, }, ], isError: true, }; } } );
- src/tools/lists.ts:281-284 (schema)Zod input schema for the 'get-list-actions' tool defining required 'listId' and optional 'filter' parameters.{ listId: z.string().describe('ID of the list to get actions for'), filter: z.string().optional().describe('Filter for action types'), },
- src/tools/lists.ts:279-326 (registration)Registration of the 'get-list-actions' tool using server.tool(), including name, input schema, and handler function within the registerListsTools function.server.tool( 'get-list-actions', { listId: z.string().describe('ID of the list to get actions for'), filter: z.string().optional().describe('Filter for action types'), }, async ({ listId, filter }) => { try { if (!credentials.apiKey || !credentials.apiToken) { return { content: [ { type: 'text', text: 'Trello API credentials are not configured', }, ], isError: true, }; } const url = new URL(`https://api.trello.com/1/lists/${listId}/actions`); url.searchParams.append('key', credentials.apiKey); url.searchParams.append('token', credentials.apiToken); if (filter) url.searchParams.append('filter', filter); const response = await fetch(url.toString()); const data = await response.json(); return { content: [ { type: 'text', text: JSON.stringify(data), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error getting list actions: ${error}`, }, ], isError: true, }; } } );