Skip to main content
Glama
agrath

Atlassian Trello MCP Server

trello_get_list_cards

Get all cards in a Trello list to view tasks in a workflow column. Supports filtering by status and selecting specific fields.

Instructions

Get all cards in a specific Trello list. Use this to see all tasks/items in a workflow column.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
apiKeyNoTrello API key (optional if TRELLO_API_KEY env var is set)
tokenNoTrello API token (optional if TRELLO_TOKEN env var is set)
listIdYesID of the list to get cards from (you can get this from get_lists)
filterNoFilter cards by status: "open" for active cards, "closed" for archived cards, "all" for bothopen
fieldsNoOptional: specific fields to include (e.g., ["name", "desc", "due", "labels", "members"])
compactNoReturn minimal fields only (id, name, url, listId). Default: true. Set to false for full details.

Implementation Reference

  • Main handler function for trello_get_list_cards. Extracts credentials, validates inputs (listId, filter, fields, compact), calls TrelloClient.getListCards(), and returns formatted card data (compact or full mode).
    export async function handleTrelloGetListCards(args: unknown) {
      try {
        const { credentials, params } = extractCredentials(args);
        const { listId, filter, fields, compact } = validateGetListCards(params);
        const client = new TrelloClient(credentials);
    
        // Default to compact mode for smaller responses
        const useCompact = compact ?? true;
    
        const response = await client.getListCards(listId, {
          ...(filter && { filter }),
          ...(fields && { fields })
        });
        const cards = response.data;
    
        const result = useCompact ? {
          summary: `Found ${cards.length} ${filter || 'open'} card(s) in list`,
          listId,
          cards: cards.map(card => ({
            id: card.id,
            name: card.name,
            url: card.shortUrl,
            listId: card.idList
          })),
          rateLimit: response.rateLimit
        } : {
          summary: `Found ${cards.length} ${filter || 'open'} card(s) in list`,
          listId,
          cards: cards.map(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,
            start: card.start,
            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
            })) || []
          })),
          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 list cards: ${errorMessage}`
            }
          ],
          isError: true
        };
      }
    }
  • Validation schema for get_list_cards inputs using Zod. Validates listId, filter (all/open/closed), fields (array of strings), and compact (boolean).
    const validateGetListCards = (args: unknown) => {
      const schema = z.object({
        listId: trelloIdSchema,
        filter: z.enum(['all', 'open', 'closed']).optional(),
        fields: z.array(z.string()).optional(),
        compact: z.boolean().optional()
      });
    
      return schema.parse(args);
    };
  • Tool definition with name 'trello_get_list_cards', description, and inputSchema (JSON Schema) listing apiKey, token, listId, filter, fields, compact parameters.
    export const trelloGetListCardsTool: Tool = {
      name: 'trello_get_list_cards',
      description: 'Get all cards in a specific Trello list. Use this to see all tasks/items in a workflow column.',
      inputSchema: {
        type: 'object',
        properties: {
          apiKey: {
            type: 'string',
            description: 'Trello API key (optional if TRELLO_API_KEY env var is set)'
          },
          token: {
            type: 'string',
            description: 'Trello API token (optional if TRELLO_TOKEN env var is set)'
          },
          listId: {
            type: 'string',
            description: 'ID of the list to get cards from (you can get this from get_lists)'
          },
          filter: {
            type: 'string',
            enum: ['all', 'open', 'closed'],
            description: 'Filter cards by status: "open" for active cards, "closed" for archived cards, "all" for both',
            default: 'open'
          },
          fields: {
            type: 'array',
            items: { type: 'string' },
            description: 'Optional: specific fields to include (e.g., ["name", "desc", "due", "labels", "members"])'
          },
          compact: {
            type: 'boolean',
            description: 'Return minimal fields only (id, name, url, listId). Default: true. Set to false for full details.',
            default: true
          }
        },
        required: ['listId']
      }
    };
  • src/index.ts:188-190 (registration)
    Tool registration in the tool list array in index.ts (Express server).
    trelloGetListCardsTool,
    trelloCreateListTool,
    // Original tools (maintained for compatibility)
  • TrelloClient.getListCards() helper method. Makes API request to /lists/{listId}/cards with optional filter and fields parameters.
    async getListCards(listId: string, options?: {
      filter?: 'all' | 'open' | 'closed';
      fields?: string[];
    }): Promise<TrelloApiResponse<TrelloCard[]>> {
      const params: Record<string, string> = {};
      
      if (options?.filter) {
        params.filter = options.filter;
      }
      if (options?.fields) {
        params.fields = options.fields.join(',');
      }
      
      return this.makeRequest<TrelloCard[]>(
        `/lists/${listId}/cards`,
        { params },
        `Get cards in list ${listId}`
      );
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden for behavioral traits. It only mentions 'Get all cards' without addressing pagination, error handling, authentication details (though params have descriptions), or any side effects. Compact and filter details are in the schema, not expanded here.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences with no unnecessary words. It is front-loaded with the main purpose. Every sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 6 parameters, no output schema, and no annotations, the description lacks important details like return format, pagination behavior, and error scenarios. It is too brief to fully guide an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the description adds little beyond clarifying the tool's purpose. The description does not provide additional context for parameters like 'filter' or 'compact' that isn't already in the schema. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get all cards'), the resource ('in a specific Trello list'), and provides context ('workflow column'). This distinguishes it from sibling tools like 'get_card' (single card) and 'trello_get_board_cards' (board-level).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives a clear usage hint ('Use this to see all tasks/items in a workflow column') but does not explicitly state when not to use it or mention alternatives. However, the purpose is well-understood given the tool name and siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/agrath/Trello-Desktop-MCP'

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