getTaskList
Retrieve all tasks from a plan with optional filtering by status to manage and organize your workflow effectively.
Instructions
获取计划中所有任务的列表,可按状态进行过滤。
Args: status_filter (str, optional): 用于过滤任务的状态字符串。 可接受的值: 'pending', 'in_progress', 'completed', 'failed', 'skipped'。
Returns: ToolResponse[List[TaskOutput]]: 包含任务列表的响应对象。
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| status_filter | No |
Implementation Reference
- src/mcplanmanager/app.py:171-183 (handler)MCP tool handler and registration for 'getTaskList'. This thin wrapper delegates to PlanManager.getTaskList() and uses type hints for schema.@mcp.tool() def getTaskList(status_filter: Optional[str] = None) -> ToolResponse[List[TaskOutput]]: """ 获取计划中所有任务的列表,可按状态进行过滤。 Args: status_filter (str, optional): 用于过滤任务的状态字符串。 可接受的值: 'pending', 'in_progress', 'completed', 'failed', 'skipped'。 Returns: ToolResponse[List[TaskOutput]]: 包含任务列表的响应对象。 """ return plan_manager.getTaskList(status_filter)
- Core logic implementation of getTaskList in PlanManager class, filters tasks by status_filter if provided and returns them wrapped in a dict.def getTaskList(self, status_filter: Optional[str] = None) -> Dict: """获取任务列表,可按状态过滤""" if status_filter: tasks_to_return = [ task for task in self.plan_data["tasks"] if task["status"] == status_filter ] else: tasks_to_return = self.plan_data["tasks"] return {"success": True, "data": tasks_to_return}
- src/mcplanmanager/models.py:33-43 (schema)Pydantic model defining the structure of each TaskOutput in the list returned by getTaskList.class TaskOutput(BaseModel): """ 用于工具函数返回任务信息时,定义单个任务输出的Pydantic模型。 """ id: int name: str status: str dependencies: List[int] reasoning: str result: Optional[str] = None
- src/mcplanmanager/models.py:5-13 (schema)Generic Pydantic model for ToolResponse[T], used as return type ToolResponse[List[TaskOutput]] for getTaskList.class ToolResponse(BaseModel, Generic[T]): """ 一个通用的工具响应模型,用于标准化所有工具的返回结构。 """ success: bool = Field(True, description="操作是否成功。") message: Optional[str] = Field(None, description="关于操作结果的可读消息。") data: Optional[T] = Field(None, description="操作返回的主要数据负载。")