list_siblings
View all sibling tasks in a hierarchical task management system to understand your position in the current task sequence, including both pending and completed tasks.
Instructions
See all sibling tasks to the left of current focus. May include both pending and completed tasks. Helpful for understanding your position in the current task sequence.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| include_body | No | Include task body content |
Implementation Reference
- src/handlers.py:198-217 (handler)The main handler function that executes the list_siblings tool. It retrieves siblings from task_manager and formats the response with optional body inclusion.async def handle_list_siblings(self, include_body: bool = False) -> Dict[str, Any]: siblings = self.task_manager.list_siblings() return { "count": len(siblings), "siblings": [ { "id": s.id, "title": s.title, "status": s.status.value, "created_at": s.created_at.isoformat(), **({"body": s.body} if include_body else {}), **( {"completed_at": s.completed_at.isoformat()} if s.completed_at else {} ), } for s in siblings ], }
- src/handlers.py:344-357 (schema)The Tool schema definition for list_siblings, including input schema for the optional include_body parameter.Tool( name="list_siblings", description="See all sibling tasks to the left of current focus. May include both pending and completed tasks. Helpful for understanding your position in the current task sequence.", inputSchema={ "type": "object", "properties": { "include_body": { "type": "boolean", "description": "Include task body content", "default": False, } }, }, ),
- src/server.py:70-72 (registration)Registration of the list_siblings tool in the server handler_map, mapping the tool call to the appropriate handler method."list_siblings": lambda: handlers.handle_list_siblings( arguments.get("include_body", False) ),
- src/task_manager.py:380-381 (helper)Helper method in TaskManager that lists siblings by delegating to get_siblings_to_left().def list_siblings(self) -> List[SubTask]: return self.get_siblings_to_left()
- src/task_manager.py:198-208 (helper)Core helper function that computes the list of sibling subtasks to the left of the current task.def get_siblings_to_left(self) -> List[SubTask]: if self.is_zen_state or not self.global_tasks: return [] last_main_task = self.global_tasks[-1] current = self.current_task if isinstance(current, MainTask) or not last_main_task.sub_tasks: return [] return last_main_task.sub_tasks[:-1]