Skip to main content
Glama
m0xai

Trello MCP Server with Python

by m0xai

get_board_labels

Retrieve all labels from a specific Trello board to organize and categorize cards effectively. Provide the board ID to access label information.

Instructions

Retrieves all labels for a specific board.

Args: board_id (str): The ID of the board whose labels to retrieve. Returns: List[TrelloLabel]: A list of label objects for the board.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
board_idYes

Implementation Reference

  • The MCP tool handler function for get_board_labels. It handles the context, logs the operation, delegates to BoardService.get_board_labels(board_id), and returns the list of labels or raises errors.
    async def get_board_labels(ctx: Context, board_id: str) -> List[TrelloLabel]: """Retrieves all labels for a specific board. Args: board_id (str): The ID of the board whose labels to retrieve. Returns: List[TrelloLabel]: A list of label objects for the board. """ try: logger.info(f"Getting labels for board: {board_id}") result = await service.get_board_labels(board_id) logger.info(f"Successfully retrieved {len(result)} labels for board: {board_id}") return result except Exception as e: error_msg = f"Failed to get board labels: {str(e)}" logger.error(error_msg) await ctx.error(error_msg) raise
  • Registers the get_board_labels tool with the MCP server by adding it to the tools list.
    mcp.add_tool(board.get_board_labels)
  • The supporting service method in BoardService that performs the actual Trello API call to fetch labels and deserializes them into TrelloLabel models.
    async def get_board_labels(self, board_id: str) -> List[TrelloLabel]: """Retrieves all labels for a specific board. Args: board_id (str): The ID of the board whose labels to retrieve. Returns: List[TrelloLabel]: A list of label objects for the board. """ response = await self.client.GET(f"/boards/{board_id}/labels") return [TrelloLabel(**label) for label in response]

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/m0xai/trello-mcp-server'

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