Skip to main content
Glama

trello_get_card_actions

Retrieve activity history and comments for a Trello card to track changes and discussions. Filter by action type and set result limits for focused review.

Instructions

Get activity history and comments for a specific Trello card. Useful for tracking changes and discussions.

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 actions for
filterNoFilter actions by type: "commentCard" for comments only, "updateCard" for updatescommentCard
limitNoMaximum number of actions to return

Implementation Reference

  • The handler function for 'trello_get_card_actions' which retrieves card actions using the TrelloClient.
    export async function handleTrelloGetCardActions(args: unknown) {
      try {
        const { apiKey, token, cardId, filter, limit } = validateGetCardActions(args);
        const client = new TrelloClient({ apiKey, token });
        
        const response = await client.getCardActions(cardId, {
          ...(filter && { filter }),
          ...(limit !== undefined && { limit })
        });
        const actions = response.data;
        
        const result = {
          summary: `Found ${actions.length} action(s) for card`,
          cardId,
          actions: actions.map(action => ({
            id: action.id,
            type: action.type,
            date: action.date,
            memberCreator: action.memberCreator ? {
              id: action.memberCreator.id,
              fullName: action.memberCreator.fullName,
              username: action.memberCreator.username
            } : null,
            data: {
              text: action.data?.text,
              old: action.data?.old,
              card: action.data?.card ? {
                id: action.data.card.id,
                name: action.data.card.name
              } : null,
              list: action.data?.list ? {
                id: action.data.list.id,
                name: action.data.list.name
              } : null
            }
          })),
          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 actions: ${errorMessage}`
            }
          ],
          isError: true
        };
      }
    }
  • Validation logic for the inputs of 'trello_get_card_actions'.
    const validateGetCardActions = (args: unknown) => {
      const schema = z.object({
        apiKey: z.string().min(1, 'API key is required'),
        token: z.string().min(1, 'Token is required'),
        cardId: z.string().regex(/^[a-f0-9]{24}$/, 'Invalid card ID format'),
        filter: z.string().optional(),
        limit: z.number().min(1).max(1000).optional()
      });
      
      return schema.parse(args);
    };
  • Registration and schema definition for the 'trello_get_card_actions' tool.
    export const trelloGetCardActionsTool: Tool = {
      name: 'trello_get_card_actions',
      description: 'Get activity history and comments for a specific Trello card. Useful for tracking changes and discussions.',
      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 actions for',
            pattern: '^[a-f0-9]{24}$'
          },
          filter: {
            type: 'string',
            enum: ['all', 'commentCard', 'updateCard', 'createCard'],
            description: 'Filter actions by type: "commentCard" for comments only, "updateCard" for updates',
            default: 'commentCard'
          },
          limit: {
            type: 'number',
            minimum: 1,
            maximum: 1000,
            description: 'Maximum number of actions to return',
            default: 50
          }
        },
        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