Skip to main content
Glama

trello_get_board_cards

Retrieve all cards from a Trello board with options to filter by status, include attachments, and view member details for organized project management.

Instructions

Get all cards from a Trello board with optional filtering and detailed information like attachments and members.

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)
boardIdYesID of the board to get cards from (you can get this from list_boards)
attachmentsNoInclude attachment information: "cover" for cover images, "true" for all attachmentsfalse
membersNoInclude member information for each cardtrue
filterNoFilter cards by statusopen

Implementation Reference

  • The handler function that executes the trello_get_board_cards tool logic.
    export async function handleTrelloGetBoardCards(args: unknown) {
      try {
        const { apiKey, token, boardId, attachments, members, filter } = validateGetBoardCards(args);
        const client = new TrelloClient({ apiKey, token });
        
        const response = await client.getBoardCards(boardId, {
          ...(attachments && { attachments }),
          ...(members && { members }),
          ...(filter && { filter })
        });
        const cards = response.data;
        
        const result = {
          summary: `Found ${cards.length} card(s) in board`,
          boardId,
          cards: cards.map(card => ({
            id: card.id,
            name: card.name,
            description: card.desc || 'No description',
            url: card.shortUrl,
            listId: card.idList,
            position: card.pos,
            due: card.due,
            dueComplete: card.dueComplete,
            closed: card.closed,
            lastActivity: card.dateLastActivity,
            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
            })) || [],
            attachments: card.attachments?.map((attachment: any) => ({
              id: attachment.id,
              name: attachment.name,
              url: attachment.url,
              mimeType: attachment.mimeType,
              date: attachment.date
            })) || []
          })),
          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 board cards: ${errorMessage}`
            }
          ],
          isError: true
        };
      }
    }
  • The tool definition, including the schema for trello_get_board_cards.
    export const trelloGetBoardCardsTool: Tool = {
      name: 'trello_get_board_cards',
      description: 'Get all cards from a Trello board with optional filtering and detailed information like attachments and members.',
      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)'
          },
          boardId: {
            type: 'string',
            description: 'ID of the board to get cards from (you can get this from list_boards)',
            pattern: '^[a-f0-9]{24}$'
          },
          attachments: {
            type: 'string',
            enum: ['cover', 'true', 'false'],
            description: 'Include attachment information: "cover" for cover images, "true" for all attachments',
            default: 'false'
          },
          members: {
            type: 'string',
            enum: ['true', 'false'],
            description: 'Include member information for each card',
            default: 'true'
          },
          filter: {
            type: 'string',
            enum: ['all', 'open', 'closed'],
            description: 'Filter cards by status',
            default: 'open'
          }
        },
        required: ['apiKey', 'token', 'boardId']
      }
    };

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