update_task
Modify task attributes (content, description, labels, priority, due date, or deadline) in Todoist by specifying the task ID and desired updates via the MCP server.
Instructions
Update an attribute of a task given its ID. Any attribute can be updated.
Args:
- task_id [str | int]: The ID of the task to update. Example '1234567890' or 1234567890
- content [str]: Task content. This value may contain markdown-formatted text and hyperlinks. Details on markdown support can be found in the Text Formatting article in the Help Center.
- description [str]: A description for the task. This value may contain markdown-formatted text and hyperlinks. Details on markdown support can be found in the Text Formatting article in the Help Center.
- labels [list[str]]: The task's labels (a list of names that may represent either personal or shared labels).
- priority [int]: Task priority from 1 (normal) to 4 (urgent).
- due_date [str]: Specific date in YYYY-MM-DD format relative to user’s timezone.
- deadline_date [str]: Specific date in YYYY-MM-DD format relative to user’s timezone.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | No | ||
| deadline_date | No | ||
| description | No | ||
| due_date | No | ||
| labels | No | ||
| priority | No | ||
| task_id | Yes |
Implementation Reference
- todoist_server.py:185-234 (handler)The primary handler function for the 'update_task' MCP tool. Decorated with @mcp.tool() for registration. Handles input parameters, constructs update data, and calls the Todoist API to update the task.@mcp.tool() def update_task( task_id: str, content: Optional[str] = None, description: Optional[str] = None, labels: Optional[list[str]] = None, priority: Optional[int] = None, due_date: Optional[str] = None, deadline_date: Optional[str] = None, ): """ Update an attribute of a task given its ID. Any attribute can be updated. Args: - task_id [str | int]: The ID of the task to update. Example '1234567890' or 1234567890 - content [str]: Task content. This value may contain markdown-formatted text and hyperlinks. Details on markdown support can be found in the Text Formatting article in the Help Center. - description [str]: A description for the task. This value may contain markdown-formatted text and hyperlinks. Details on markdown support can be found in the Text Formatting article in the Help Center. - labels [list[str]]: The task's labels (a list of names that may represent either personal or shared labels). - priority [int]: Task priority from 1 (normal) to 4 (urgent). - due_date [str]: Specific date in YYYY-MM-DD format relative to user’s timezone. - deadline_date [str]: Specific date in YYYY-MM-DD format relative to user’s timezone. """ # Client sometimes struggle to convert int to str task_id = task_id.strip('"') try: data = {} if content: data["content"] = content if description: data["description"] = description if labels: if isinstance(labels, str): labels = [labels] data["labels"] = labels if priority: data["priority"] = priority if due_date: data["due_date"] = due_date if deadline_date: data["deadline_date"] = deadline_date is_success = todoist_api.update_task(task_id=task_id, **data) if not is_success: raise Exception return "Task updated successfully" except Exception as e: raise Exception(f"Couldn't update task {str(e)}")