get_cards
Retrieve all tasks from a Focalboard with pagination support to manage and organize your project workflow efficiently.
Instructions
List all cards (tasks) in a board with pagination support.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| boardId | Yes | The ID of the board to list cards from | |
| page | No | Page number for pagination (default: 0) | |
| perPage | No | Number of cards per page (default: 100) |
Implementation Reference
- src/index.ts:356-374 (handler)MCP tool handler for 'get_cards': extracts parameters, validates boardId, calls focalboard.getCards, and returns JSON stringified cards.case 'get_cards': { const boardId = args?.boardId as string; const page = (args?.page as number) || 0; const perPage = (args?.perPage as number) || 100; if (!boardId) { throw new Error('boardId is required'); } const cards = await focalboard.getCards(boardId, page, perPage); return { content: [ { type: 'text', text: JSON.stringify(cards, null, 2) } ] }; }
- src/index.ts:108-131 (schema)Input schema definition for the 'get_cards' tool, including parameters boardId (required), page, and perPage with defaults.{ name: 'get_cards', description: 'List all cards (tasks) in a board with pagination support.', inputSchema: { type: 'object', properties: { boardId: { type: 'string', description: 'The ID of the board to list cards from' }, page: { type: 'number', description: 'Page number for pagination (default: 0)', default: 0 }, perPage: { type: 'number', description: 'Number of cards per page (default: 100)', default: 100 } }, required: ['boardId'] } },
- src/focalboard-client.ts:202-209 (helper)Implementation of getCards method in FocalboardClient that makes the API request to fetch cards from the board with pagination.async getCards(boardId: string, page: number = 0, perPage: number = 100): Promise<Card[]> { return this.makeRequest<Card[]>( `/boards/${boardId}/cards`, 'GET', undefined, { page: page.toString(), per_page: perPage.toString() } ); }