get_card
Retrieve detailed information about a specific Trello card including content, status, members, and attachments to track project progress and team collaboration.
Instructions
Get detailed information about a specific Trello card, including its content, status, members, and attachments.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| apiKey | Yes | Trello API key (automatically provided by Claude.app from your stored credentials) | |
| token | Yes | Trello API token (automatically provided by Claude.app from your stored credentials) | |
| cardId | Yes | ID of the card to retrieve (you can get this from board details or searches) | |
| includeDetails | No | Include additional details like members, labels, checklists, and activity badges |
Implementation Reference
- src/tools/cards.ts:363-444 (handler)The `handleGetCard` function handles the logic for executing the `get_card` tool by calling the TrelloClient and returning the card data.
export async function handleGetCard(args: unknown) { try { const { apiKey, token, cardId, includeDetails } = validateGetCard(args); const client = new TrelloClient({ apiKey, token }); const response = await client.getCard(cardId, includeDetails); const card = response.data; const result = { summary: `Card: ${card.name}`, card: { id: card.id, name: card.name, description: card.desc || 'No description', url: card.shortUrl, listId: card.idList, boardId: card.idBoard, position: card.pos, due: card.due, dueComplete: card.dueComplete, closed: card.closed, lastActivity: card.dateLastActivity, ...(includeDetails && { labels: card.labels?.map(label => ({ id: label.id, name: label.name, color: label.color })) || [], members: card.members?.map(member => ({ id: member.id, fullName: member.fullName, username: member.username, initials: member.initials })) || [], checklists: card.checklists?.map(checklist => ({ id: checklist.id, name: checklist.name, checkItems: checklist.checkItems?.map(item => ({ id: item.id, name: item.name, state: item.state, due: item.due })) || [] })) || [], badges: card.badges ? { votes: card.badges.votes, comments: card.badges.comments, attachments: card.badges.attachments, checkItems: card.badges.checkItems, checkItemsChecked: card.badges.checkItemsChecked, description: card.badges.description } : undefined }) }, rateLimit: response.rateLimit }; return { content: [ { type: 'text' as const, text: JSON.stringify(result, null, 2) } ] }; } catch (error) { const errorMessage = error instanceof z.ZodError ? formatValidationError(error) : error instanceof Error ? error.message : 'Unknown error occurred'; return { content: [ { type: 'text' as const, text: `Error getting card: ${errorMessage}` } ], isError: true }; } - src/tools/cards.ts:334-361 (schema)The `getCardTool` constant defines the name, description, and input schema for the `get_card` tool.
export const getCardTool: Tool = { name: 'get_card', description: 'Get detailed information about a specific Trello card, including its content, status, members, and attachments.', inputSchema: { type: 'object', properties: { apiKey: { type: 'string', description: 'Trello API key (automatically provided by Claude.app from your stored credentials)' }, token: { type: 'string', description: 'Trello API token (automatically provided by Claude.app from your stored credentials)' }, cardId: { type: 'string', description: 'ID of the card to retrieve (you can get this from board details or searches)', pattern: '^[a-f0-9]{24}$' }, includeDetails: { type: 'boolean', description: 'Include additional details like members, labels, checklists, and activity badges', default: false } }, required: ['apiKey', 'token', 'cardId'] } };