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
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"task_id": "<task_id>"
},
"name": "delete_task"
}
}Input 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)}")