trello_get_card_attachments
Retrieve all file and link attachments from a specific Trello card to access supporting documents and resources.
Instructions
Get all attachments (files, links) for a specific Trello card.
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 get attachments for | |
| fields | No | Optional: specific fields to include (e.g., ["name", "url", "mimeType", "date"]) |
Implementation Reference
- src/tools/advanced.ts:322-376 (handler)Handler implementation for 'trello_get_card_attachments' that validates input, fetches attachments via TrelloClient, and formats the response.
export async function handleTrelloGetCardAttachments(args: unknown) { try { const { apiKey, token, cardId, fields } = validateGetCardAttachments(args); const client = new TrelloClient({ apiKey, token }); const response = await client.getCardAttachments(cardId, { ...(fields && { fields }) }); const attachments = response.data; const result = { summary: `Found ${attachments.length} attachment(s) for card`, cardId, attachments: attachments.map(attachment => ({ id: attachment.id, name: attachment.name, url: attachment.url, mimeType: attachment.mimeType, date: attachment.date, bytes: attachment.bytes, isUpload: attachment.isUpload, previews: attachment.previews?.map((preview: any) => ({ id: preview.id, width: preview.width, height: preview.height, url: preview.url })) || [] })), 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 attachments: ${errorMessage}` } ], isError: true }; - src/tools/advanced.ts:293-320 (schema)Definition and input schema for the 'trello_get_card_attachments' tool.
export const trelloGetCardAttachmentsTool: Tool = { name: 'trello_get_card_attachments', description: 'Get all attachments (files, links) for a specific Trello card.', 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 get attachments for', pattern: '^[a-f0-9]{24}$' }, fields: { type: 'array', items: { type: 'string' }, description: 'Optional: specific fields to include (e.g., ["name", "url", "mimeType", "date"])' } }, required: ['apiKey', 'token', 'cardId'] } };