get_subtasks
Retrieve subtasks for a parent task in DeltaTask MCP Server to manage task hierarchies and organize project workflows.
Instructions
Get subtasks for a given parent task ID.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| parent_id | Yes |
Implementation Reference
- server.py:89-92 (handler)MCP tool handler for 'get_subtasks': retrieves subtasks for a given parent_id using TaskService.get_all_tasks(parent_id=parent_id).@mcp.tool() async def get_subtasks(parent_id: str) -> list[dict[str, Any]]: """Get subtasks for a given parent task ID.""" return service.get_all_tasks(parent_id=parent_id)
- TaskService.get_all_tasks method, called by the tool handler, fetches tasks filtered by parent_id from repository and adds subtasks recursively only for top-level queries.def get_all_tasks(self, include_completed: bool = False, parent_id: Optional[str] = None, tags: List[str] = None) -> List[Dict[str, Any]]: """Get all tasks with optional filtering and their subtasks.""" # Get tasks from database tasks = self.repository.get_todos(include_completed, parent_id, tags) # Only add subtasks for top-level tasks if parent_id is None: for task in tasks: self._recursively_add_subtasks(task) return tasks