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
| Name | Required | Description | Default |
|---|---|---|---|
| card_id | Yes |
Implementation Reference
- server/tools/card.py:21-39 (handler)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
- server/tools/tools.py:24-24 (registration)Registers the 'get_card' tool with the MCP server instance.mcp.add_tool(card.get_card)
- server/services/card.py:19-30 (helper)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)