Skip to main content
Glama
m0xai

Trello MCP Server with Python

by m0xai

get_list

Retrieve a specific Trello list by its ID to access list details and manage board organization.

Instructions

Retrieves a specific list by its ID.

Args:
    list_id (str): The ID of the list to retrieve.

Returns:
    TrelloList: The list object containing list details.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
list_idYes

Implementation Reference

  • The main handler function for the 'get_list' MCP tool. It handles the context, logging, error handling, and delegates to the ListService.
    async def get_list(ctx: Context, list_id: str) -> TrelloList:
        """Retrieves a specific list by its ID.
    
        Args:
            list_id (str): The ID of the list to retrieve.
    
        Returns:
            TrelloList: The list object containing list details.
        """
        try:
            logger.info(f"Getting list with ID: {list_id}")
            result = await service.get_list(list_id)
            logger.info(f"Successfully retrieved list: {list_id}")
            return result
        except Exception as e:
            error_msg = f"Failed to get list: {str(e)}"
            logger.error(error_msg)
            await ctx.error(error_msg)
            raise
  • Registers the 'get_list' tool with the MCP server instance.
    mcp.add_tool(list.get_list)
  • Helper method in ListService that makes the actual Trello API call to fetch the list by ID.
    async def get_list(self, list_id: str) -> TrelloList:
        """Retrieves a specific list by its ID.
    
        Args:
            list_id (str): The ID of the list to retrieve.
    
        Returns:
            TrelloList: The list object containing list details.
        """
        response = await self.client.GET(f"/lists/{list_id}")
        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