Skip to main content
Glama
m0xai

Trello MCP Server with Python

by m0xai

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
NameRequiredDescriptionDefault
board_idYes

Implementation Reference

  • 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
  • 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
  • Registers the get_lists handler function as an MCP tool.
    mcp.add_tool(list.get_lists)
  • 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]

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