skipTask
Mark tasks as skipped in MCPlanManager to resolve dependencies and allow subsequent tasks to proceed. Specify a task ID and reason for skipping.
Instructions
将指定ID的任务标记为 'skipped' (已跳过)。 被跳过的任务在依赖解析中被视为“已完成”,允许后续任务继续。
Args: task_id (int): 需要跳过的任务的ID (从0开始)。 reason (str): 解释为何跳过此任务的字符串。
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_id | Yes | ||
| reason | Yes |
Implementation Reference
- src/mcplanmanager/app.py:135-145 (handler)MCP tool handler and registration for skipTask. This thin wrapper delegates to PlanManager.skipTask for the core logic.@mcp.tool() def skipTask(task_id: int, reason: str) -> ToolResponse[TaskOutput]: """ 将指定ID的任务标记为 'skipped' (已跳过)。 被跳过的任务在依赖解析中被视为“已完成”,允许后续任务继续。 Args: task_id (int): 需要跳过的任务的ID (从0开始)。 reason (str): 解释为何跳过此任务的字符串。 """ return plan_manager.skipTask(task_id, reason)
- Core implementation of skipTask logic in PlanManager class. Finds the task, validates status, marks it as skipped, updates result and timestamp.def skipTask(self, task_id: int, reason: str) -> Dict: """跳过任务""" task = self._find_task_by_id(task_id) if not task: return {"success": False, "message": f"Task {task_id} not found"} if task["status"] not in ["pending", "failed"]: return {"success": False, "message": f"Only pending or failed tasks can be skipped. Task {task_id} has status '{task['status']}'"} task["status"] = "skipped" task["result"] = f"Skipped: {reason}" self._update_timestamp() return { "success": True, "data": task, "message": f"Task {task_id} skipped. Reason: {reason}" }