Skip to main content
Glama

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
NameRequiredDescriptionDefault
apiKeyYesTrello API key (automatically provided by Claude.app from your stored credentials)
tokenYesTrello API token (automatically provided by Claude.app from your stored credentials)
cardIdYesID of the card to get attachments for
fieldsNoOptional: specific fields to include (e.g., ["name", "url", "mimeType", "date"])

Implementation Reference

  • 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
        };
  • 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']
      }
    };

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kocakli/Trello-Desktop-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server