delete_card
Remove a card from Trello boards using its unique ID to manage board content and organization.
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 function for 'delete_card'. It handles the context, logging, error handling, and delegates to CardService.delete_card.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:28-28 (registration)Registration of the 'delete_card' tool in the MCP server using mcp.add_tool.mcp.add_tool(card.delete_card)
- server/services/card.py:70-80 (helper)The underlying CardService helper method that executes the Trello API DELETE request for the card.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}")