get_task
Retrieve a specific Todoist task by its ID to view details or manage it through the Todoist MCP Server.
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)MCP tool handler for 'get_task', registered via @mcp.tool() decorator, formats and returns task details by delegating to TodoistClient.@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)Core implementation in TodoistClient that fetches the specific task from Todoist REST API using GET /tasks/{task_id}.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-24 (schema)Pydantic BaseModel schema for TodoistTask, defining the structure parsed from API response in get_task.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 = ""