Skip to content

Humans as tools

Agents and MCPMCPDashboardescalate_and_waitescalate_to_humancheck_resolutionlong-tail-human-queue

An agent routes work to a person through the same tool protocol it uses for everything else, and gets the typed answer back.

The situation

An agent working through a task reaches a decision it should not make alone: approve a refund, confirm a shipping address, supply a password. It needs a person, and it should ask the way it calls any other tool.

The recipe

The long-tail-human-queue server exposes the escalation queue as MCP tools. Inside a workflow or a compiled pipeline, escalate_and_wait creates the row and pauses until it resolves:

tool call: escalate_and_wait
{
"role": "reviewer",
"message": "Approve a refund of $240 on order ORD-1042?",
"data": { "orderId": "ORD-1042", "amount": 240 },
"form_schema": {
"type": "object",
"properties": {
"approved": { "type": "boolean" },
"note": { "type": "string" }
},
"required": ["approved"]
},
"priority": 1
}

The row appears in the reviewer queue on the dashboard with the form rendered. When a reviewer submits, the step after the wait receives { approved, note }. escalate_to_human plus check_resolution is the fire-and-check variant.

Tool Purpose
escalate_to_human Create an escalation, return its id
escalate_and_wait Create an escalation and pause until it resolves
check_resolution Read status and resolver payload
get_available_work List pending, unclaimed rows for a role
claim_and_resolve Claim and resolve in one atomic call

The guarantee

Human labor and AI labor compose through one protocol: the row is the same whether a person clicks a button or an agent calls a tool. These tools act with full authority, so at /mcp they list for superadmin accounts. An external agent with another role works the queue through the role-checked tools (find_escalations, claim_escalation, admin_resolve_escalation). See MCP.