Skip to main content
Glama

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
NameRequiredDescriptionDefault
task_idYes
reasonYes

Implementation Reference

  • 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}"
        }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/donway19/MCPlanManager'

If you have feedback or need assistance with the MCP directory API, please join our Discord server