Skip to main content
Glama
m0xai

Trello MCP Server with Python

by m0xai

create_list

Add a new list to a Trello board to organize tasks and workflows. Specify board ID, list name, and position for structured project management.

Instructions

Creates a new list on a given board.

Args:
    board_id (str): The ID of the board to create the list in.
    name (str): The name of the new list.
    pos (str, optional): The position of the new list. Can be "top" or "bottom". Defaults to "bottom".

Returns:
    TrelloList: The newly created list object.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
board_idYes
nameYes
posNobottom

Implementation Reference

  • MCP tool handler for create_list: executes the logic, handles errors, logs, and calls the service.
    async def create_list(
        ctx: Context, board_id: str, name: str, pos: str = "bottom"
    ) -> TrelloList:
        """Creates a new list on a given board.
    
        Args:
            board_id (str): The ID of the board to create the list in.
            name (str): The name of the new list.
            pos (str, optional): The position of the new list. Can be "top" or "bottom". Defaults to "bottom".
    
        Returns:
            TrelloList: The newly created list object.
        """
        try:
            logger.info(f"Creating list '{name}' in board: {board_id}")
            result = await service.create_list(board_id, name, pos)
            logger.info(f"Successfully created list '{name}' in board: {board_id}")
            return result
        except Exception as e:
            error_msg = f"Failed to create list: {str(e)}"
            logger.error(error_msg)
            await ctx.error(error_msg)
            raise
  • Registers the create_list tool handler with the MCP server.
    mcp.add_tool(list.create_list)
  • Core service method that performs the actual Trello API call to create a list.
    async def create_list(
        self, board_id: str, name: str, pos: str = "bottom"
    ) -> TrelloList:
        """Creates a new list on a given board.
    
        Args:
            board_id (str): The ID of the board to create the list in.
            name (str): The name of the new list.
            pos (str, optional): The position of the new list. Can be "top" or "bottom". Defaults to "bottom".
    
        Returns:
            TrelloList: The newly created list object.
        """
        data = {"name": name, "idBoard": board_id, "pos": pos}
        response = await self.client.POST("/lists", data=data)
        return TrelloList(**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