delete_task
Remove a specific task from ClickUp by providing its Task ID. This function is part of the ClickUp MCP Server, enabling AI assistants to manage project workflows efficiently.
Instructions
Delete a task
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_id | Yes | Task ID to delete |
Implementation Reference
- src/clickup_mcp/tools.py:720-729 (handler)The main handler function for the 'delete_task' MCP tool. It resolves the flexible task ID using _resolve_task_id and delegates to the ClickUpClient's delete_task method.async def delete_task(self, task_id: str) -> Dict[str, Any]: """Delete a task.""" try: # First resolve the task to get the internal ID task = await self._resolve_task_id(task_id) await self.client.delete_task(task.id) return {"id": task.id, "deleted": True} except ClickUpAPIError as e: return {"error": f"Failed to delete task '{task_id}': {e!s}"}
- src/clickup_mcp/tools.py:140-150 (schema)The Tool schema definition for 'delete_task', specifying the input schema requiring a 'task_id' string.Tool( name="delete_task", description="Delete a task", inputSchema={ "type": "object", "properties": { "task_id": {"type": "string", "description": "Task ID to delete"}, }, "required": ["task_id"], }, ),
- src/clickup_mcp/tools.py:27-27 (registration)Registration of the 'delete_task' handler in the ClickUpTools._tools dictionary, used by call_tool to dispatch invocations."delete_task": self.delete_task,
- src/clickup_mcp/client.py:319-322 (helper)Supporting method in ClickUpClient that sends the DELETE request to the ClickUp API to delete the task by ID.async def delete_task(self, task_id: str) -> None: """Delete a task.""" await self._request("DELETE", f"/task/{task_id}")