Skip to main content
Glama

update_task

Modify existing Todoist tasks by updating content, due dates, priorities, labels, or descriptions to keep task management current and accurate.

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
NameRequiredDescriptionDefault
task_idYes
contentNo
descriptionNo
labelsNo
priorityNo
due_stringNo
due_dateNo

Implementation Reference

  • The MCP tool handler for 'update_task'. It validates inputs via type hints, constructs updates dictionary from provided parameters, calls the TodoistClient.update_task method, and returns a formatted 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}"
        )
  • Helper method in TodoistClient that performs the HTTP POST request to Todoist's REST API to update the task with the given updates.
    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)
  • The @mcp.tool() decorator registers the update_task function as an MCP tool with the name 'update_task' using FastMCP.
    @mcp.tool()

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/dan-bailey/todoist-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server