get_task
Retrieve a specific Todoist task using its unique ID to access task details and information for management purposes.
Instructions
Get a specific task by ID.
Args:
task_id: The ID of the task to retrieve
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_id | Yes |
Implementation Reference
- todoist_mcp/server.py:78-99 (handler)The handler function for the 'get_task' MCP tool. It is decorated with @mcp.tool() for automatic registration and implements the tool logic by calling the TodoistClient and formatting the response as a string.@mcp.tool() async def get_task(task_id: str) -> str: """Get a specific task by ID. Args: task_id: The ID of the task to retrieve """ _check_client() task = await todoist_client.get_task(task_id) return ( f"Task: {task.content}\n" f"ID: {task.id}\n" f"Description: {task.description}\n" f"Completed: {task.is_completed}\n" f"Priority: {task.priority}\n" f"Labels: {', '.join(task.labels) if task.labels else 'None'}\n" f"Due: {task.due_string or task.due_date or 'None'}\n" f"Project ID: {task.project_id}\n" f"URL: {task.url}" )
- todoist_mcp/client.py:96-99 (helper)The underlying helper method in TodoistClient that fetches a specific task from the Todoist API and parses it into a TodoistTask model.async def get_task(self, task_id: str) -> TodoistTask: """Get a specific task by ID.""" data = await self._request("GET", f"/tasks/{task_id}") return TodoistTask(**data)
- todoist_mcp/client.py:9-25 (schema)Pydantic model defining the structure and validation for TodoistTask objects used in the get_task implementation.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 = ""