Skip to main content
Glama
m0xai

Trello MCP Server with Python

by m0xai

get_cards

Retrieve all cards from a specific Trello list to view tasks, manage workflows, and track project progress.

Instructions

Retrieves all cards in a given list.

Args: list_id (str): The ID of the list whose cards to retrieve. Returns: List[TrelloCard]: A list of card objects.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
list_idYes

Implementation Reference

  • MCP tool handler for 'get_cards' that retrieves Trello cards from a list using CardService, logs actions, and handles errors via context.
    async def get_cards(ctx: Context, list_id: str) -> List[TrelloCard]: """Retrieves all cards in a given list. Args: list_id (str): The ID of the list whose cards to retrieve. Returns: List[TrelloCard]: A list of card objects. """ try: logger.info(f"Getting cards for list: {list_id}") result = await service.get_cards(list_id) logger.info(f"Successfully retrieved {len(result)} cards for list: {list_id}") return result except Exception as e: error_msg = f"Failed to get cards: {str(e)}" logger.error(error_msg) await ctx.error(error_msg) raise
  • Registration of the 'get_cards' tool with the MCP server instance.
    mcp.add_tool(card.get_cards)
  • CardService method implementing the core logic to fetch cards from Trello API via GET /lists/{list_id}/cards and parse into TrelloCard models.
    async def get_cards(self, list_id: str) -> List[TrelloCard]: """Retrieves all cards in a given list. Args: list_id (str): The ID of the list whose cards to retrieve. Returns: List[TrelloCard]: A list of card objects. """ response = await self.client.GET(f"/lists/{list_id}/cards") return [TrelloCard(**card) for card 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