Skip to main content
Glama

trello_get_board_labels

Retrieve all available labels from a specific Trello board to categorize and organize cards effectively.

Instructions

Get all labels available on a specific Trello board for categorizing cards.

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 labels for

Implementation Reference

  • The handler function that executes the trello_get_board_labels tool.
    export async function handleTrelloGetBoardLabels(args: unknown) {
      try {
        const { apiKey, token, boardId } = validateGetBoardLabels(args);
        const client = new TrelloClient({ apiKey, token });
        
        const response = await client.getBoardLabels(boardId);
        const labels = response.data;
        
        const result = {
          summary: `Found ${labels.length} label(s) on board`,
          boardId,
          labels: labels.map(label => ({
            id: label.id,
            name: label.name,
            color: label.color,
            uses: label.uses
          })),
          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 labels: ${errorMessage}`
            }
          ],
          isError: true
        };
      }
    }
  • Input validation schema for the tool arguments.
    const validateGetBoardLabels = (args: unknown) => {
      const schema = z.object({
        apiKey: z.string().min(1, 'API key is required'),
        token: z.string().min(1, 'Token is required'),
        boardId: z.string().regex(/^[a-f0-9]{24}$/, 'Invalid board ID format')
      });
      
      return schema.parse(args);
    };
  • Registration of the tool with its name, description, and input schema.
    export const trelloGetBoardLabelsTool: Tool = {
      name: 'trello_get_board_labels',
      description: 'Get all labels available on a specific Trello board for categorizing cards.',
      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 labels for',
            pattern: '^[a-f0-9]{24}$'
          }
        },
        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