Long-Running AI Content Jobs With MCP Tasks and Elicitation: Pausing Agents for Editor Input
A bulk translation job dies at item 312 of 800 because the client disconnected, and the part that did finish quietly rewrote a pricing page nobody approved. The fix has two parts.
A bulk translation job dies at item 312 of 800 because the client disconnected, and the part that did finish quietly rewrote a pricing page nobody approved. The fix has two parts. Run bulk AI content jobs as MCP Tasks, which return a task ID right away and keep working in the background. Then use MCP elicitation to pause the task and ask an editor whenever an item is high risk. In Sanity, the agent writes to drafts or Content Releases through the MCP server and Agent Actions, and editors answer and review in the Studio.
The cost of getting this wrong is concrete. A single blocking tool call can't survive minutes of work, so teams either split jobs into fragile batches or let agents write straight to live content. In both cases, a regulated claim, a price, or a legal clause can change without anyone reviewing it.
This guide treats human-in-the-loop as a step in the protocol, not a meeting. Risk is classified in the content model. Low-risk items continue automatically, and high-risk items stop the task until an editor confirms a change, chooses an option, or fills in a field.
What are MCP Tasks and why do bulk content jobs need them?
MCP Tasks are durable state machines for tool calls that take too long to finish in a single request. Tasks entered the Model Context Protocol specification in version 2025-11-25 as an experimental feature. They now ship as the official Tasks extension (io.modelcontextprotocol/tasks, based on SEP-2663 and published as the @modelcontextprotocol/ext-tasks package), whose 2026-07-28 schema is marked Stable. This guide targets that 2026-07-28 version.
The mechanics are simple. A client makes a task-augmented tools/call and immediately receives a CreateTaskResult with a task ID that the server generates. The client can then poll with tasks/get, list running jobs with tasks/list, and stop one with tasks/cancel. Tools opt in through execution.taskSupport, which is set to required, optional, or forbidden. The extension's README names the workload directly: requests that run for minutes, wait for human input, or need to survive a disconnected client.
Most AI content operations fit that description. Translating hundreds of product pages into several locales, enriching a catalog with generated descriptions and attributes, and migrating a legacy site into a new content model all take minutes or hours. If you run them as one blocking call, a timeout, a sleeping laptop, or a network blip throws away the work in flight. Teams then end up maintaining brittle batching scripts and restarting jobs by hand.
With MCP Tasks, a bulk translation becomes a single task ID. An editor or the orchestrating agent can check progress, fetch the result later, and cancel cleanly if the source content turns out to be wrong. The job's state lives on the server, not in whichever chat window started it.
Tasks make jobs durable. They don't make jobs correct. A task that runs reliably for an hour will just as reliably write a bad legal disclaimer into every target locale. That is why MCP Tasks need to be paired with elicitation, and why where each write lands matters as much as which job runner you use.
Which MCP version this guide targets
How does MCP elicitation turn human-in-the-loop into a protocol step?
MCP elicitation lets a server ask a human for input in the middle of a job by sending an elicitation/create request. In the 2026-07-28 specification, that request travels inside an InputRequiredResult, and clients declare support for it in _meta.io.modelcontextprotocol/clientCapabilities. Combined with MCP Tasks, this lets a background job move to an input-required status, wait for an answer, and then continue.
Elicitation has two modes. Form mode collects structured data in-band through a requestedSchema. That schema is deliberately limited to flat objects with primitive properties: strings (with email, uri, date, and date-time formats), numbers or integers, booleans, and single- or multi-select enums. URL mode sends the user to an external URL for interactions that should not pass through the MCP client at all.
Those primitives cover the three things an editor actually does during review. Confirming is a boolean, for example "Publish this translated warranty clause as written?" Choosing is an enum, such as "Which of these three generated product titles fits the brand?" Filling in a field is a string or a number, as in "The source has no EU price. Enter one, or leave it blank to hold this item." Anything richer, such as reviewing a full page in context, belongs in URL mode.
The spec also sets guardrails that matter to content teams. Clients must show which server is asking, offer clear decline and cancel options, and let users review their responses before sending them. Servers must not use form mode to collect passwords, API keys, tokens, or payment credentials, so any step involving credentials belongs in URL mode or outside the agent entirely.
With elicitation, human review is no longer an out-of-band chat message that someone may or may not see. It becomes a typed step in the job, with a defined schema and a defined set of outcomes (accept, decline, or cancel). The task state also shows everyone that the work is waiting on a person, not failing silently.

How do I implement human-in-the-loop for high-risk content types automatically?
To make human-in-the-loop automatic, classify risk in the content model and run bulk work as MCP Tasks. Low-risk items go straight to drafts, and the task pauses with an elicitation whenever an item crosses a risk threshold. The six steps below are a design pattern, not a single product feature, and they work with any MCP-capable agent.
Step 1: classify risk in the content model. Mark risk by document type (legal pages, pricing, medical or regulated claims, the homepage) and by field. A disclaimer field carries more risk than an alt-text field, even on the same document.
Step 2: run the bulk job as a task-augmented tool call. Translation, catalog enrichment, and migration each return a task ID and run in the background.
Step 3: send low-risk items straight to drafts or a Content Release. Nothing goes live at this point. These items simply don't need a person to step in during the job.
Step 4: pause on high-risk items. Move the task to input required and send a form-mode elicitation (a boolean to confirm, an enum to choose, or a string to fill in). Alternatively, send a URL-mode elicitation that deep-links the editor to the release in the Studio.
Step 5: require a human release. Nothing the agent touched is published until an editor releases it.
Step 6: audit with queries. Afterward, check which documents changed, who changed them, and which path the change took.
Step 1 is the most important design choice. If risk rules live in a spreadsheet or in the agent's prompt, they drift away from how editors actually work. If they live in the schema, every agent and every automation reads the same definition. In Sanity, document types and fields are defined in schema code, so a risk classification can sit next to the content it governs. The orchestrating agent can read it with a GROQ query before deciding whether to continue or elicit.
Step 5 is the backstop. Even a well-tuned classifier will misfire, so the safe default is that agent output lands in drafts or release versions and a person promotes it.
Durability scales mistakes as well as work
Which content types and risk levels should trigger an elicitation?
Trigger an elicitation for any item where a wrong answer is expensive, irreversible, or impossible for the model to know. Don't trigger one anywhere else. Over-triggering is a failure mode of its own: an editor who gets three hundred confirmation prompts about alt text will start clicking accept without reading, and that is worse than having no gate.
A workable model uses three tiers. Tier one is low risk: alt text, internal tags, SEO descriptions on blog posts, and machine translation of interface strings. These run fully automatically into drafts. Tier two is medium risk: product descriptions, marketing landing pages, and translated long-form articles. These land in a Content Release for batch review when the task finishes, with no pause during the job. Tier three is high risk: legal terms, pricing, medical or regulated claims, and the homepage. These pause the task and trigger an elicitation before any write happens.
Document type is a coarse filter, and six escalation triggers catch what a type rule misses. Field sensitivity escalates a pricing field even on an otherwise low-risk document. Low model confidence escalates when the agent's own check flags uncertainty. Missing source data escalates when a source document lacks a value for a required field, which is a natural fit for a fill-in elicitation. A conflicting reference escalates when generated content points to a product or author that doesn't match the source. Any irreversible action, such as publishing or deleting, escalates regardless of tier.
The choose pattern is especially useful for catalog enrichment. Instead of letting the model commit to one generated title, have it produce three and send an enum elicitation. The editor makes one click, a human still decides the brand voice, and the task continues without anyone opening a separate tool.
Putting these tiers in the schema is what the Model your business pillar means in practice: the content model records how the business actually works, including which content needs a human decision and which content doesn't.
Where does Sanity fit in an MCP Tasks and elicitation workflow?
In this workflow, Sanity is where the agent's writes land and where editors review them. The Tasks and elicitation layer belongs to the orchestrating agent or MCP server your team runs. The agent works through Sanity's Agent API and MCP server, writes to drafts or Content Releases, and editors answer elicitations and review the results in the Studio.
The Sanity MCP server is hosted at https://mcp.sanity.io and set up with npx sanity@latest mcp configure. Through it, agents can execute GROQ queries, manage releases, and patch documents with full awareness of the schema, so the orchestrator doesn't have to paste content models into a prompt. To edit a release version, the agent calls create_version before patch_documents, which keeps the change inside the release instead of on the published document.
Agent Actions handle the content transformations: Generate, Transform, Translate, Patch, and Prompt, all of which can target drafts. Translate creates new draft documents from a source document, so a bulk localization task is reviewable by default rather than a set of overwrites.
Permissions matter just as much. OAuth is the default. When an API token is set in the Authorization header instead, tool calls are limited to that token's role and permissions. A personal token shares your role and links you to any changes in the revision history. If you give a bulk agent its own scoped token, its role determines where it can write, and that limit holds even if the agent misbehaves.
This is what it means for Sanity to be the Content Operating System for the AI era. Legacy CMSes bolt on AI. Sanity is built for it, with structured models, event-driven workflows, agents, and Agent Actions that keep AI contextual, governable, and part of content operations instead of running alongside them. Under the Power anything pillar, that means giving agents context with full governance and control, without a separate path around the editorial process.
How do editors review and audit agent-written content in the Studio?
Editors review agent-written content in the Studio by working through the drafts and Content Releases the agent produced. Teams automate the checks and notifications around that review with Functions. Because the agent never publishes directly, a person always takes the last step before content goes live.
Functions are generally available. They are small, single-purpose pieces of TypeScript or JavaScript that run on Sanity's infrastructure, react to content changes, and are declared in a Blueprint (sanity.blueprint.ts). Document functions trigger on create, update, and delete events. Two settings matter for agent output. includeDrafts, false by default, controls whether drafts.** events trigger the function. includeAllVersions, also false by default, controls whether versions.** events from Content Releases and Scheduled Drafts trigger it. With includeAllVersions turned on, a Function can flag every release version the agent writes, or notify the editor responsible for that document type when a high-risk item is waiting.
For staged editorial processes, Sanity Workflows is in beta, which means it is opt-in and may change before general availability. Workflows are defined in TypeScript and versioned and deployed like the rest of your code, so the process can't drift from what is written down. The documented example matches this article's pattern: a person submits a draft, and an agent checks it against the style guide and either moves it forward or sends it back.
Auditing is where structured content pays off. Workflows leave a trail in the content repository instead of a separate system, so a question such as "what published without legal review" is a single GROQ query rather than a dig through logs. That same query is how you prove that your risk tiers held up after a bulk job.
Very long waits are the remaining gap. Sanity has announced Durable Functions, with steps that retry, share state, and wait as long as an approval takes, but they have not shipped. For now, long pauses for editor input belong in the MCP Tasks layer, while Functions and Content Releases handle the content side.
Human-in-the-loop for long-running agent content jobs: Sanity compared
| Feature | Sanity | Contentful | LangChain.js + MCP SDK | Vercel AI SDK |
|---|---|---|---|---|
| Running bulk jobs as MCP Tasks | Your orchestrating agent runs the task, and writes go through Sanity's MCP server and Agent Actions. Translate creates new draft documents, so a long job ends as reviewable drafts. | Supports automated AI steps in the platform. Long-running MCP task orchestration is built by your team outside Contentful and connected to its APIs. | An orchestration library. With the MCP TypeScript SDK and @modelcontextprotocol/ext-tasks you can implement Tasks, but storage and review destinations are yours to build. | Built for wiring LLM calls into web apps. Durable background tasks need the MCP SDK and Tasks extension plus your own persistence and content store. |
| Where agent output lands | Drafts or Content Releases through the MCP server. Calling create_version before patch_documents keeps edits inside a release instead of on published content. | Agent writes go to entries through its management APIs. Whether output is staged or live depends on how your space's workflow and apps are configured. | Output goes wherever your tools write. The library has no content store, so whether output lands as a draft or goes live is decided in your tool code and the backend behind it. | Output goes wherever your server code sends it, so draft staging and release grouping have to come from the CMS behind the app. |
| Risk tiers encoded in the content model | The schema is defined in code, so document types and fields can carry a risk classification that the agent reads with GROQ before deciding whether to continue or elicit. | Schemas are managed in the platform. Review gates for specific content types are usually built through UI extensions or apps that sit in fixed slots. | Risk rules live in prompts or tool code unless the backing CMS models them, which lets the agent's rules drift from the editors' rules. | Risk logic sits in application code. Keeping it in sync with editorial policy depends on the content backend you pair it with. |
| Review surface for elicited items | A URL-mode elicitation can deep-link editors into the Studio to review a Content Release. Sanity Workflows (beta) adds agent-assisted editorial stages. | Offers an editorial UI and AI automation. Custom review gates for agent jobs are typically built as apps or UI extensions. | No editor UI of its own. Form-mode elicitations render in whatever MCP client you use, and full-page review needs a separate surface. | Lets you build a custom review UI inside your app, but roles, revision history, and governance are yours to implement or delegate to a CMS. |
| Reacting to agent writes automatically | Functions (GA) trigger on create, update, and delete events. The includeDrafts and includeAllVersions settings let them flag agent-written drafts and release versions. | Webhooks and apps can react to entry changes. Its AI automation supports automated steps, though with fewer customization options and less context. | Callbacks observe the agent's own run, not content changes in the CMS. Content-change events have to come from the content backend. | Reacts within the request lifecycle of your app. Content-change events have to come from the CMS or a separate queue you operate. |
| Scoped permissions and audit trail | API tokens limit MCP tool calls to their role. Personal tokens tie changes to revision history, and audits like 'what published without legal review' are GROQ queries. | Roles and API keys govern access. Tracing which agent job made which change depends on what your apps record. | Tools use whatever credentials you hand them. An audit trail means adding tracing yourself or through a separate observability product. | Uses your server's credentials. The audit trail and change attribution are built in your app or delegated to the CMS behind it. |