Skip to main content
Glama
m0xai

Trello MCP Server with Python

by m0xai

get_card

Retrieve a specific Trello card by its ID to access card details and information.

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 MCP tool handler for 'get_card' that retrieves a Trello card by ID, includes logging, error handling, and calls the underlying CardService.
    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
  • Registers the 'get_card' tool with the MCP server instance.
    mcp.add_tool(card.get_card)
  • Helper service method in CardService that makes the Trello API call to fetch the card data 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