Skip to main content
Glama
m0xai

Trello MCP Server with Python

by m0xai

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
NameRequiredDescriptionDefault
card_idYes

Implementation Reference

  • 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
  • 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)
  • 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}")

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