Skip to main content
Glama
m0xai

Trello MCP Server with Python

by m0xai

get_card

Retrieve specific Trello card details by providing the card ID to access information from Trello boards.

Instructions

Retrieves a specific card by its ID.

Args:
    card_id (str): The ID of the card to retrieve.

Returns:
    TrelloCard: The card object containing card details.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
card_idYes

Implementation Reference

  • The primary MCP tool handler function for 'get_card'. It takes a card_id, calls the CardService to fetch the Trello card, handles errors, and returns the TrelloCard object.
    async def get_card(ctx: Context, card_id: str) -> TrelloCard:
        """Retrieves a specific card by its ID.
    
        Args:
            card_id (str): The ID of the card to retrieve.
    
        Returns:
            TrelloCard: The card object containing card details.
        """
        try:
            logger.info(f"Getting card with ID: {card_id}")
            result = await service.get_card(card_id)
            logger.info(f"Successfully retrieved card: {card_id}")
            return result
        except Exception as e:
            error_msg = f"Failed to get card: {str(e)}"
            logger.error(error_msg)
            await ctx.error(error_msg)
            raise
  • Registration of the 'get_card' tool with the MCP server using mcp.add_tool.
    mcp.add_tool(card.get_card)
  • Helper service method in CardService that makes the actual Trello API call to retrieve the card by ID and parses it into a TrelloCard model.
    async def get_card(self, card_id: str) -> TrelloCard:
        """Retrieves a specific card by its ID.
    
        Args:
            card_id (str): The ID of the card to retrieve.
    
        Returns:
            TrelloCard: The card object containing card details.
        """
        response = await self.client.GET(f"/cards/{card_id}")
        return TrelloCard(**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