Class RespondToEscalationTool

java.lang.Object
ai.tabforge.workshop.RespondToEscalationTool

public class RespondToEscalationTool extends Object
MCP Tool: respond_to_escalation

Human-in-the-loop re-entry point. Claude calls this tool after the developer has responded to an escalation question presented by GetReportTool. Passes the developer's decision to

invalid reference
OrchestratorAgent#resumeAfterEscalation()
which unblocks the paused agent thread and continues the review.

Flow:


 GetReportTool returns { status: "AWAITING_HUMAN", question: "..." }
     ↓
 Claude presents question to developer
     ↓
 Developer responds: "Accept the fix"
     ↓
 Claude → calls respond_to_escalation(reviewId, decision: "ACCEPT_FIX")
     ↓
 RespondToEscalationTool → creates HumanDecision
                         → calls OrchestratorAgent.resumeAfterEscalation()
                         → agent thread unblocks, review continues
     ↓
 Claude → calls GetReportTool periodically to track progress
 

Created by: WorkshopServer.start() at server startup. Receives OrchestratorAgent via constructor injection.

CERTIFICATION NOTE — covers two exam domains:

  • Domain 4 — Tool Design & MCP Integration (18%): The DESCRIPTION field defines all valid decision values and tells Claude exactly what to do after calling this tool — resume polling or inform the developer of cancellation. This is Task Statement 4.1: "Design MCP tool interfaces with clear descriptions and input schemas."
  • Domain 1 — Agentic Architecture & Orchestration (27%): This tool implements the human-in-the-loop pattern — the moment where an autonomous agentic loop pauses and yields control to a human, then resumes based on the human's verdict. This is one of the most tested patterns in the exam. Task Statement 1.7: "Manage session state, resumption, and forking."

  • Constructor Details

    • RespondToEscalationTool

      public RespondToEscalationTool(OrchestratorAgent orchestrator)
  • Method Details

    • toolSpecification

      public io.modelcontextprotocol.server.McpServerFeatures.AsyncToolSpecification toolSpecification(io.modelcontextprotocol.json.McpJsonMapper jsonMapper)