Skip to main content
Glama
m0xai

Trello MCP Server with Python

by m0xai

get_lists

Retrieve all lists from a Trello board to organize tasks, track progress, and manage workflows using the board ID.

Instructions

Retrieves all lists on a given board.

Args:
    board_id (str): The ID of the board whose lists to retrieve.

Returns:
    List[TrelloList]: A list of list objects.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
board_idYes

Implementation Reference

  • The MCP tool handler function for get_lists that retrieves lists for a board by calling the ListService.
    async def get_lists(ctx: Context, board_id: str) -> List[TrelloList]:
        """Retrieves all lists on a given board.
    
        Args:
            board_id (str): The ID of the board whose lists to retrieve.
    
        Returns:
            List[TrelloList]: A list of list objects.
        """
        try:
            logger.info(f"Getting lists for board: {board_id}")
            result = await service.get_lists(board_id)
            logger.info(f"Successfully retrieved {len(result)} lists for board: {board_id}")
            return result
        except Exception as e:
            error_msg = f"Failed to get lists: {str(e)}"
            logger.error(error_msg)
            await ctx.error(error_msg)
            raise
  • Registration of the get_lists tool in the MCP server.
    mcp.add_tool(list.get_lists)
  • The underlying service method that calls the Trello API to fetch lists for the given board.
    async def get_lists(self, board_id: str) -> List[TrelloList]:
        """Retrieves all lists on a given board.
    
        Args:
            board_id (str): The ID of the board whose lists to retrieve.
    
        Returns:
            List[TrelloList]: A list of list objects.
        """
        response = await self.client.GET(f"/boards/{board_id}/lists")
        return [TrelloList(**list_data) for list_data 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