update_task
Modify existing Todoist tasks by updating content, description, labels, priority, or due dates to keep your task list current and organized.
Instructions
Update an existing task.
Args:
task_id: The ID of the task to update
content: Updated task content/title
description: Updated task description
labels: Updated list of label names
priority: Updated priority from 1 (normal) to 4 (urgent)
due_string: Updated human readable due date
due_date: Updated ISO 8601 formatted due date
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_id | Yes | ||
| content | No | ||
| description | No | ||
| labels | No | ||
| priority | No | ||
| due_string | No | ||
| due_date | No |
Implementation Reference
- todoist_mcp/server.py:149-193 (handler)The primary MCP tool handler for 'update_task'. Decorated with @mcp.tool(), it processes input parameters into an updates dict, calls the TodoistClient's update_task method, and returns a success message with task details.@mcp.tool() async def update_task( task_id: str, content: Optional[str] = None, description: Optional[str] = None, labels: Optional[List[str]] = None, priority: Optional[int] = None, due_string: Optional[str] = None, due_date: Optional[str] = None ) -> str: """Update an existing task. Args: task_id: The ID of the task to update content: Updated task content/title description: Updated task description labels: Updated list of label names priority: Updated priority from 1 (normal) to 4 (urgent) due_string: Updated human readable due date due_date: Updated ISO 8601 formatted due date """ _check_client() updates = {} if content is not None: updates["content"] = content if description is not None: updates["description"] = description if labels is not None: updates["labels"] = labels if priority is not None: updates["priority"] = priority if due_string is not None: updates["due_string"] = due_string if due_date is not None: updates["due_date"] = due_date task = await todoist_client.update_task(task_id, **updates) return ( f"Task updated successfully!\n" f"ID: {task.id}\n" f"Title: {task.content}\n" f"URL: {task.url}" )
- todoist_mcp/client.py:137-140 (helper)Helper method in TodoistClient that makes the actual POST request to Todoist's REST API /tasks/{task_id} endpoint with the updates payload and returns the updated TodoistTask object.async def update_task(self, task_id: str, **updates) -> TodoistTask: """Update an existing task.""" data = await self._request("POST", f"/tasks/{task_id}", json=updates) return TodoistTask(**data)
- todoist_mcp/client.py:9-25 (schema)Pydantic model defining the structure of a TodoistTask, used for output validation/parsing in the update_task operations.class TodoistTask(BaseModel): """Represents a Todoist task.""" id: str content: str description: str = "" is_completed: bool = False labels: List[str] = [] priority: int = 1 due_string: Optional[str] = None due_date: Optional[str] = None project_id: str = "" section_id: Optional[str] = None parent_id: Optional[str] = None order: int = 0 url: str = "" created_at: str = ""