get_task_by_id
Retrieve detailed information for a specific task using its unique identifier from the DeltaTask task management system.
Instructions
Get details for a specific task by ID.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_id | Yes |
Implementation Reference
- server.py:17-23 (handler)MCP tool handler for 'get_task_by_id' registered with @mcp.tool(). It calls TaskService.get_task_by_id and handles not found case.@mcp.tool() async def get_task_by_id(task_id: str) -> dict[str, Any]: """Get details for a specific task by ID.""" task = service.get_task_by_id(task_id) if not task: return {"error": "Task not found"} return task
- TaskService helper method that retrieves task by ID from repository, adds subtasks recursively, and returns the task or error.def get_task_by_id(self, task_id: str) -> Dict[str, Any]: """Get a specific task by ID with its subtasks.""" task = self.repository.get_todo_by_id(task_id) if not task: return {"error": "Task not found"} # Add subtasks self._recursively_add_subtasks(task) return task