delete_posts
Remove posts from Kanka campaign entities to manage content and maintain organization. Specify entity and post IDs to delete unwanted entries.
Instructions
Delete posts from entities
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| deletions | Yes |
Implementation Reference
- src/mcp_kanka/tools.py:153-167 (handler)handle_delete_posts: The MCP tool handler that receives parameters and delegates to the operations layerasync def handle_delete_posts(**params: Any) -> list[DeletePostResult]: """ Delete posts from entities. Args: **params: Parameters from DeletePostsParams Returns: List of deletion results """ deletions = params.get("deletions", []) operations = get_operations() # Delegate to operations layer return await operations.delete_posts(deletions)
- src/mcp_kanka/operations.py:652-692 (handler)delete_posts: The actual implementation that iterates through deletion requests and calls the service's delete_post method for eachasync def delete_posts( self, deletions: list[dict[str, Any]] ) -> list[DeletePostResult]: """Delete posts from entities. Args: deletions: List of post deletions to perform Returns: List of results, one per post """ results = [] for deletion in deletions: try: # Delete post success = self.service.delete_post( entity_id=deletion["entity_id"], post_id=deletion["post_id"], ) result: DeletePostResult = { "entity_id": deletion["entity_id"], "post_id": deletion["post_id"], "success": success, "error": None, } results.append(result) except Exception as e: logger.error( f"Failed to delete post {deletion['post_id']} from entity {deletion['entity_id']}: {e}" ) error_result: DeletePostResult = { "entity_id": deletion["entity_id"], "post_id": deletion["post_id"], "success": False, "error": str(e), } results.append(error_result) return results
- src/mcp_kanka/types.py:121-131 (schema)PostDeletion and DeletePostsParams: TypedDict schemas defining the input parameters for delete_posts toolclass PostDeletion(TypedDict): """Deletion for a post.""" entity_id: int post_id: int class DeletePostsParams(TypedDict): """Parameters for delete_posts tool.""" deletions: list[PostDeletion]
- src/mcp_kanka/types.py:266-273 (schema)DeletePostResult: TypedDict schema defining the output structure for delete_posts operationsclass DeletePostResult(TypedDict): """Result of deleting a post.""" entity_id: int post_id: int success: bool error: str | None
- src/mcp_kanka/__main__.py:341-367 (registration)Tool registration: Defines the delete_posts MCP tool with name, description, and input schema for validationtypes.Tool( name="delete_posts", description="Delete posts from entities", inputSchema={ "type": "object", "properties": { "deletions": { "type": "array", "items": { "type": "object", "properties": { "entity_id": { "type": "integer", "description": "The entity ID", }, "post_id": { "type": "integer", "description": "The post ID to delete", }, }, "required": ["entity_id", "post_id"], }, } }, "required": ["deletions"], }, ),