getExecutableTaskList
Retrieve pending tasks with all dependencies satisfied to identify immediate next actions in AI agent task management.
Instructions
获取当前所有依赖已满足且状态为 'pending' 的可执行任务列表。
Returns: ToolResponse[List[TaskOutput]]: 包含可执行任务列表的响应对象。
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/mcplanmanager/app.py:185-193 (handler)The MCP tool handler for 'getExecutableTaskList', decorated with @mcp.tool() which registers the tool and defines its interface. It delegates execution to the PlanManager instance.@mcp.tool() def getExecutableTaskList() -> ToolResponse[List[TaskOutput]]: """ 获取当前所有依赖已满足且状态为 'pending' 的可执行任务列表。 Returns: ToolResponse[List[TaskOutput]]: 包含可执行任务列表的响应对象。 """ return plan_manager.getExecutableTaskList()
- Core implementation logic in PlanManager class that computes the list of executable tasks by filtering pending tasks with all dependencies satisfied.def getExecutableTaskList(self) -> Dict: """获取所有可执行的任务列表""" executable_tasks = [] for task in self.plan_data["tasks"]: if task["status"] == "pending" and self._check_dependencies_satisfied(task): executable_tasks.append(task) return {"success": True, "data": executable_tasks}
- src/mcplanmanager/models.py:33-43 (schema)Pydantic model defining the structure of individual TaskOutput objects returned in the tool's List[TaskOutput] response.class TaskOutput(BaseModel): """ 用于工具函数返回任务信息时,定义单个任务输出的Pydantic模型。 """ id: int name: str status: str dependencies: List[int] reasoning: str result: Optional[str] = None
- src/mcplanmanager/models.py:6-13 (schema)Generic Pydantic model wrapping the tool response, used as ToolResponse[List[TaskOutput]] for input/output schema.class ToolResponse(BaseModel, Generic[T]): """ 一个通用的工具响应模型,用于标准化所有工具的返回结构。 """ success: bool = Field(True, description="操作是否成功。") message: Optional[str] = Field(None, description="关于操作结果的可读消息。") data: Optional[T] = Field(None, description="操作返回的主要数据负载。")
- src/mcplanmanager/app.py:9-9 (registration)Instantiation of the PlanManager instance used by the tool handler. (Note: Registration is via @mcp.tool() decorator on the handler.)plan_manager = PlanManager()