Skip to main content
Glama

get_cards_by_list_id

Retrieve all cards from a specified Trello list by providing the list ID. Simplify card management and integration with Trello boards using structured data.

Instructions

Fetch cards from a specific Trello list

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
listIdYesID of the Trello list

Implementation Reference

  • MCP server tool handler for 'get_cards_by_list_id': validates arguments using validateGetCardsListRequest, calls TrelloClient.getCardsByList, and returns JSON stringified cards.
    case 'get_cards_by_list_id': { const validArgs = validateGetCardsListRequest(args); const cards = await this.trelloClient.getCardsByList(validArgs.listId); return { content: [{ type: 'text', text: JSON.stringify(cards, null, 2) }], }; }
  • Input schema validation function specifically for the get_cards_by_list_id tool, ensuring listId is a non-empty string.
    export function validateGetCardsListRequest(args: Record<string, unknown>): { listId: string } { if (!args.listId) { throw new McpError(ErrorCode.InvalidParams, 'listId is required'); } return { listId: validateString(args.listId, 'listId'), }; }
  • src/index.ts:62-74 (registration)
    Registration of the 'get_cards_by_list_id' tool in the MCP server, including name, description, and input schema definition.
    name: 'get_cards_by_list_id', description: 'Fetch cards from a specific Trello list', inputSchema: { type: 'object', properties: { listId: { type: 'string', description: 'ID of the Trello list', }, }, required: ['listId'], }, },
  • TrelloClient helper method implementing the core logic: makes authenticated API request to fetch cards from the specified list ID, with rate limiting and error handling.
    async getCardsByList(listId: string): Promise<TrelloCard[]> { console.error(`[TrelloClient] Getting cards for list: ${listId}`); return this.handleRequest(async () => { const response = await this.axiosInstance.get(`/lists/${listId}/cards`); return response.data; }); }

Other Tools

Related Tools

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

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