get_lists
Retrieve all lists from a Trello board to view, organize, or manage board structure and workflow.
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
| Name | Required | Description | Default |
|---|---|---|---|
| board_id | Yes |
Implementation Reference
- server/tools/list.py:41-59 (handler)The MCP tool handler function for 'get_lists' that takes a board_id, calls the ListService to fetch lists, handles errors, and returns List[TrelloList].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
- server/models.py:17-25 (schema)Pydantic BaseModel defining the TrelloList structure used for output serialization and validation in the get_lists tool.class TrelloList(BaseModel): """Model representing a Trello list.""" id: str name: str closed: bool = False idBoard: str pos: float
- server/tools/tools.py:18-18 (registration)Registers the get_lists handler function as an MCP tool.mcp.add_tool(list.get_lists)
- server/services/list.py:28-38 (helper)Helper service method in ListService that makes the Trello API call to fetch lists for the board and parses responses into TrelloList objects.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]