Skip to main content
Glama

get-list-cards

Retrieve cards from a specific Trello list with options to filter by status and select fields for efficient project tracking and management.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
listIdYesID of the list to get cards from
fieldsNoComma-separated list of card fields to include
filterNoFilter for card types (e.g., "open", "closed", "all")

Implementation Reference

  • Registration of the 'get-list-cards' tool using server.tool, including input schema (listId, optional fields and filter) and the handler function that constructs the Trello API URL for /lists/{listId}/cards and fetches the cards.
    server.tool( 'get-list-cards', { listId: z.string().describe('ID of the list to get cards from'), fields: z.string().optional().describe('Comma-separated list of card fields to include'), filter: z.string().optional().describe('Filter for card types (e.g., "open", "closed", "all")'), }, async ({ listId, fields, 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}/cards`); url.searchParams.append('key', credentials.apiKey); url.searchParams.append('token', credentials.apiToken); if (fields) url.searchParams.append('fields', fields); 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 cards: ${error}`, }, ], isError: true, }; } } );
  • src/index.ts:89-89 (registration)
    Top-level call to registerListsTools, which includes the registration of 'get-list-cards'.
    registerListsTools(server, credentials);
  • An alias implementation named 'get-tickets-by-list' in cards.ts that performs the same logic as 'get-list-cards'.
    // GET /lists/{id}/cards - Get tickets by list (alias for get-list-cards) server.tool( 'get-tickets-by-list', { listId: z.string().describe('ID of the list to get tickets from'), limit: z.number().optional().describe('Maximum number of cards to return'), }, async ({ listId, limit }) => { 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}/cards`); url.searchParams.append('key', credentials.apiKey); url.searchParams.append('token', credentials.apiToken); if (limit) url.searchParams.append('limit', limit.toString()); 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 tickets by list: ${error}`, }, ], isError: true, }; } } );

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/adriangrahldev/advanced-trello-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server