get_cards
Retrieve cards from a Trello board or specific list to view tasks and manage project workflows.
Instructions
Get cards from a board or specific list
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| request | Yes |
Implementation Reference
- src/index.ts:178-184 (handler)Handler for the 'get_cards' tool. Extracts board_id and optional list_id from arguments, calls TrelloClient.getCards, and returns JSON stringified cards.case 'get_cards': { const { board_id, list_id } = (request.params.arguments as { request: GetCardsRequest }).request; const cards = await this.trelloClient.getCards(board_id, list_id); return { content: [{ type: 'text', text: JSON.stringify(cards, null, 2) }], }; }
- src/index.ts:86-110 (registration)Registration of the 'get_cards' tool in the ListToolsRequestHandler, including name, description, and inputSchema.{ name: 'get_cards', description: 'Get cards from a board or specific list', inputSchema: { type: 'object', properties: { request: { type: 'object', properties: { board_id: { type: 'string', description: 'ID of the board', }, list_id: { type: 'string', description: 'Optional ID of a specific list', }, }, required: ['board_id'], }, }, required: ['request'], title: 'get_cardsArguments', }, },
- src/types.ts:49-52 (schema)TypeScript interface definition for GetCardsRequest, used for type-checking the tool arguments in the handler.export interface GetCardsRequest { board_id: string; list_id?: string; }
- src/trello-client.ts:30-36 (helper)Core implementation of fetching cards from Trello API, either from a specific list or all board cards, called by the tool handler.async getCards(boardId: string, listId?: string): Promise<Card[]> { const endpoint = listId ? `${this.baseUrl}/lists/${listId}/cards` : `${this.baseUrl}/boards/${boardId}/cards`; const response = await axios.get(`${endpoint}?${this.getAuthParams()}`); return response.data; }