delete_card
Remove a specific card from Trello boards by providing its unique ID to manage your project tasks efficiently.
Instructions
Deletes a card.
Args:
card_id (str): The ID of the card to delete.
Returns:
dict: The response from the delete operation.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| card_id | Yes |
Implementation Reference
- server/tools/card.py:112-130 (handler)The MCP tool handler for 'delete_card'. Logs the deletion attempt, delegates to CardService.delete_card, handles success/error logging and returns the result.async def delete_card(ctx: Context, card_id: str) -> dict: """Deletes a card. Args: card_id (str): The ID of the card to delete. Returns: dict: The response from the delete operation. """ try: logger.info(f"Deleting card: {card_id}") result = await service.delete_card(card_id) logger.info(f"Successfully deleted card: {card_id}") return result except Exception as e: error_msg = f"Failed to delete card: {str(e)}" logger.error(error_msg) await ctx.error(error_msg) raise
- server/tools/tools.py:23-28 (registration)Registration of card-related tools, including delete_card, in the MCP server.# Card Tools mcp.add_tool(card.get_card) mcp.add_tool(card.get_cards) mcp.add_tool(card.create_card) mcp.add_tool(card.update_card) mcp.add_tool(card.delete_card)
- server/services/card.py:70-80 (helper)The core deletion logic in CardService, which calls the Trello API DELETE endpoint.async def delete_card(self, card_id: str) -> Dict[str, Any]: """Deletes a card. Args: card_id (str): The ID of the card to delete. Returns: Dict[str, Any]: The response from the delete operation. """ return await self.client.DELETE(f"/cards/{card_id}")