Skip to main content
Glama
m0xai

Trello MCP Server with Python

by m0xai

get_board_labels

Retrieve all labels for a specific Trello board to organize and categorize tasks effectively.

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 main MCP tool handler function `get_board_labels` that executes the tool logic: logs the request, calls the BoardService to fetch labels, logs success, returns the list, or handles and reports errors via ctx.error.
    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)
  • Helper service method in BoardService that makes the Trello API call to fetch board labels and deserializes the response into a list of TrelloLabel objects.
    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