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
| Name | Required | Description | Default |
|---|---|---|---|
| task_id | Yes |
Input Schema (JSON Schema)
{
"properties": {
"task_id": {
"title": "Task Id",
"type": "string"
}
},
"required": [
"task_id"
],
"title": "delete_taskArguments",
"type": "object"
}
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)}")