delete_task
Remove a specific task from Todoist by providing its unique task ID using this tool, enabling efficient task management through the Todoist Python MCP Server.
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 main handler function for the 'delete_task' tool. It is decorated with @mcp.tool(), which registers it as an MCP tool. The function deletes a task using the Todoist API by its ID and handles errors.@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)}")