Skip to content

Task Tools

Alessio Rocchi edited this page Jan 29, 2026 · 2 revisions

Task Tools

8 MCP tools for task coordination, plus 5 consensus tools for high-stakes task approval.


Core Task Tools

task_create

Create a new task for an agent type with optional drift detection and consensus checking.

Input:

{
  "agentType": "coder",
  "input": "Implement JWT validation",
  "sessionId": "session-id",
  "parentTaskId": "parent-task-uuid",
  "riskLevel": "medium"
}

Output:

{
  "success": true,
  "task": {
    "id": "uuid",
    "agentType": "coder",
    "status": "pending",
    "parentTaskId": "parent-task-uuid",
    "riskLevel": "medium",
    "depth": 1
  },
  "drift": {
    "isDrift": false,
    "highestSimilarity": 0.45,
    "action": "allowed"
  }
}

New Parameters:

  • parentTaskId: Link to parent task for drift detection
  • riskLevel: low | medium | high for consensus checking

Note: If drift is detected with prevent behavior or consensus is required, task creation may be blocked.


task_assign

Assign task to specific agent.

Input:

{
  "taskId": "task-id",
  "agentId": "agent-id"
}

task_complete

Mark task as completed.

Input:

{
  "taskId": "task-id",
  "output": "Implementation completed",
  "status": "completed"
}

task_list

List tasks with filters.

Input:

{
  "sessionId": "session-id",
  "status": "pending"
}

task_get

Get task details.

Input:

{
  "taskId": "task-id"
}

Drift Detection Tools

task_check_drift

Check if a task description would trigger drift detection against ancestor tasks.

Input:

{
  "taskInput": "Implement payment processing",
  "taskType": "coder",
  "parentTaskId": "parent-task-uuid"
}

Output:

{
  "success": true,
  "result": {
    "isDrift": true,
    "highestSimilarity": 0.97,
    "mostSimilarTaskId": "ancestor-uuid",
    "mostSimilarTaskInput": "Original task description...",
    "action": "warned",
    "checkedAncestors": 3
  },
  "config": {
    "enabled": true,
    "threshold": 0.95,
    "warningThreshold": 0.85,
    "behavior": "warn"
  }
}

Required: taskInput, taskType


task_get_relationships

Get relationships for a task (parent/child, dependencies).

Input:

{
  "taskId": "task-uuid",
  "direction": "both"
}

Output:

{
  "success": true,
  "count": 3,
  "relationships": [
    {
      "id": "rel-uuid",
      "fromTaskId": "parent-uuid",
      "toTaskId": "task-uuid",
      "relationshipType": "parent_of",
      "createdAt": "2026-01-29T10:00:00Z"
    }
  ]
}

Direction Options: outgoing | incoming | both


task_drift_metrics

Get drift detection metrics and statistics.

Input:

{
  "since": "2026-01-01T00:00:00Z"
}

Output:

{
  "success": true,
  "metrics": {
    "totalEvents": 150,
    "allowedCount": 120,
    "warnedCount": 25,
    "preventedCount": 5,
    "averageSimilarity": 0.65
  },
  "recentEvents": [
    {
      "id": "event-uuid",
      "taskId": "task-uuid",
      "taskType": "coder",
      "ancestorTaskId": "ancestor-uuid",
      "similarityScore": 0.96,
      "actionTaken": "warned",
      "createdAt": "2026-01-29T10:00:00Z"
    }
  ],
  "config": {
    "enabled": true,
    "threshold": 0.95,
    "warningThreshold": 0.85,
    "ancestorDepth": 3,
    "behavior": "warn"
  }
}

Consensus Tools

Consensus checkpoints provide human-in-the-loop approval for high-risk task creation.

consensus_check

Check if a task would require consensus before creation.

Input:

{
  "agentType": "coder",
  "input": "Deploy to production",
  "parentTaskId": "parent-uuid",
  "riskLevel": "high"
}

Output:

{
  "success": true,
  "requiresConsensus": true,
  "reason": "Risk level 'high' at depth 2 requires consensus",
  "riskLevel": "high",
  "depth": 2,
  "config": {
    "enabled": true,
    "requireForRiskLevels": ["high", "medium"],
    "maxDepth": 5
  }
}

consensus_list_pending

List pending consensus checkpoints awaiting approval.

Input:

{
  "limit": 10,
  "offset": 0
}

Output:

{
  "success": true,
  "count": 2,
  "checkpoints": [
    {
      "id": "checkpoint-uuid",
      "taskId": "task-uuid",
      "parentTaskId": "parent-uuid",
      "riskLevel": "high",
      "status": "pending",
      "reviewerStrategy": "adversarial",
      "subtaskCount": 3,
      "createdAt": "2026-01-29T10:00:00Z",
      "expiresAt": "2026-01-29T10:05:00Z"
    }
  ]
}

consensus_get

Get a consensus checkpoint by ID.

Input:

{
  "checkpointId": "checkpoint-uuid"
}

Output:

{
  "success": true,
  "checkpoint": {
    "id": "checkpoint-uuid",
    "taskId": "task-uuid",
    "parentTaskId": "parent-uuid",
    "proposedSubtasks": [
      {
        "id": "subtask-uuid",
        "agentType": "coder",
        "input": "Implement feature X",
        "estimatedRiskLevel": "medium"
      }
    ],
    "riskLevel": "high",
    "status": "pending",
    "reviewerStrategy": "adversarial",
    "createdAt": "2026-01-29T10:00:00Z",
    "expiresAt": "2026-01-29T10:05:00Z"
  }
}

consensus_approve

Approve a consensus checkpoint.

Input:

{
  "checkpointId": "checkpoint-uuid",
  "reviewedBy": "user-123",
  "feedback": "Approved after security review"
}

Output:

{
  "success": true,
  "checkpoint": {
    "id": "checkpoint-uuid",
    "status": "approved",
    "decidedAt": "2026-01-29T10:02:00Z"
  }
}

Required: checkpointId, reviewedBy


consensus_reject

Reject a consensus checkpoint (fully or partially).

Input:

{
  "checkpointId": "checkpoint-uuid",
  "reviewedBy": "user-123",
  "feedback": "Security concerns with subtask 2",
  "rejectedSubtaskIds": ["subtask-uuid-2"]
}

Output:

{
  "success": true,
  "checkpoint": {
    "id": "checkpoint-uuid",
    "status": "rejected",
    "decidedAt": "2026-01-29T10:02:00Z"
  }
}

Required: checkpointId, reviewedBy

Optional: rejectedSubtaskIds for partial rejection


Understanding Drift Detection

Drift detection prevents semantic drift - when subtasks gradually deviate from the original task scope.

How It Works

  1. When a task is created with parentTaskId, the system generates an embedding of the task input
  2. The embedding is compared against ancestor tasks up to ancestorDepth levels
  3. If similarity exceeds threshold, drift is detected

Configuration

{
  "driftDetection": {
    "enabled": true,
    "threshold": 0.95,
    "warningThreshold": 0.85,
    "ancestorDepth": 3,
    "behavior": "warn",
    "asyncEmbedding": true
  }
}

Behaviors

Behavior Action
warn Log warning but allow task creation
prevent Block task creation if drift detected

Understanding Consensus

Consensus checkpoints ensure human approval before high-risk operations.

When Required

  • Task risk level in requireForRiskLevels (default: high, medium)
  • Task depth within maxDepth (default: 5)
  • Task has a parent (root tasks don't require consensus)

Risk Estimation

Risk is automatically estimated based on:

  • Agent type: coder, devops, security-auditor → high risk
  • Input patterns: "delete", "production", "credentials" → high risk
  • Configurable: Custom patterns via highRiskPatterns, mediumRiskPatterns

Reviewer Strategies

Strategy Description
adversarial Spawn adversarial agent to review
different-model Use different LLM for review
human Require human approval

Related:

Clone this wiki locally