delete_task
Remove tasks from Todoist by specifying their unique ID to clean up completed or unnecessary items from your task list.
Instructions
Delete a task by its ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_id | Yes |
Implementation Reference
- todoist_server.py:124-134 (handler)The handler function for the 'delete_task' tool, decorated with @mcp.tool() to register it with the MCP server. It takes a task_id, strips quotes, calls the Todoist API to delete the task, and returns success or raises an exception.@mcp.tool() def delete_task(task_id: str): """Delete a task by its ID""" try: task_id = task_id.strip('"') is_success = todoist_api.delete_task(task_id=task_id) if not is_success: raise Exception return "Task deleted successfully" except Exception as e: raise Exception(f"Couldn't delete task {str(e)}")