A city developer needs Claude to poll the permit database between model turns while building a permitting agent. Which construction approach best supports that custom loop?
Select an answer to reveal the explanation.
Short Explanation
Polling the permit DB between turns is like checking the inbox between phone calls. The Agent SDK harness is the receptionist who checks, then puts Claude back on the line with fresh results.
Full Explanation
Using the Claude Agent SDK to wrap a custom harness that polls the permit database between Claude turns best supports a city developer building a permitting agent with inter-turn polling. Custom loops need an outer runtime that can call municipal systems, feed tool results back, decide whether to poll again, and then continue the model turn. The Agent SDK patterns exist to structure that harness—session control, tool registration, and turn lifecycle—rather than stuffing side effects into prompt text alone.
Exposing the permit database through an MCP server for Claude to query during each turn fails to match the stem's specific requirement: an MCP tool call happens inside a turn, at the model's request, which is useful but is not the same as an outer harness that polls between turns on its own schedule independent of whether Claude asks. Implementing permit lookups as API tool calls that Claude triggers inside a turn fails for the same reason: a tool call is initiated by the model mid-turn, so it cannot drive the kind of inter-turn polling loop the city developer needs—something has to run the loop around Claude, and a tool call alone is not that outer loop. Packaging the permit checks as a Claude Agent Skill with bundled database scripts fails because a Skill packages reusable instructions and scripts for the model to invoke, not an external runtime that polls a database between model turns and decides when to re-engage Claude; that orchestration role belongs to a harness, not a Skill.
Exam caveat: the SDK enables construction; you still must implement safe poll intervals, idempotency, and credentials handling. Do not confuse "custom harness" with unbounded autonomous action against production permit systems.
Operational check: implement an Agent SDK harness that registers permit lookup tools, polls between turns with backoff and timeouts, returns structured permit status into the next model input, and logs poll cadence and failures for city IT review.