get_task_by_id
Retrieve detailed information for a specific task using its unique ID to manage and organize tasks efficiently within the DeltaTask MCP Server 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' decorated with @mcp.tool(). Retrieves task details via TaskService 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
- Core implementation in TaskService that fetches task from repository, recursively adds subtasks, and returns task or error if not found.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