get_card_table
Retrieve card table details for a specific project by providing the project ID. Integrates with Basecamp 3 to manage project-related data efficiently.
Instructions
Get the card table details for a project
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | The project ID |
Implementation Reference
- src/index.ts:607-619 (handler)Main handler for the 'get_card_table' MCP tool. Fetches the card table for a project using BasecampClient methods and returns JSON-formatted details.case 'get_card_table': { const cardTable = await client.getCardTable(typedArgs.project_id); const cardTableDetails = await client.getCardTableDetails(typedArgs.project_id, cardTable.id); return { content: [{ type: 'text', text: JSON.stringify({ status: 'success', card_table: cardTableDetails }, null, 2) }] }; }
- src/index.ts:178-187 (registration)Tool registration in the listTools handler, including name, description, and input schema.name: 'get_card_table', description: 'Get the card table details for a project', inputSchema: { type: 'object', properties: { project_id: { type: 'string', description: 'The project ID' }, }, required: ['project_id'], }, },
- src/index.ts:180-186 (schema)Input schema definition for the get_card_table tool.inputSchema: { type: 'object', properties: { project_id: { type: 'string', description: 'The project ID' }, }, required: ['project_id'], },
- src/lib/basecamp-client.ts:123-129 (helper)Helper method to retrieve the first card table for a project.async getCardTable(projectId: string): Promise<any> { const cardTables = await this.getCardTables(projectId); if (!cardTables.length) { throw new Error(`No card tables found for project: ${projectId}`); } return cardTables[0]; }
- src/lib/basecamp-client.ts:131-141 (helper)Helper method to fetch detailed card table information via API.async getCardTableDetails(projectId: string, cardTableId: string): Promise<CardTable> { try { const response = await this.client.get(`/buckets/${projectId}/card_tables/${cardTableId}.json`); return response.data; } catch (error: any) { if (error.response?.status === 204) { return { id: cardTableId, title: 'Card Table', lists: [], status: 'empty' }; } throw error; } }