A clerk filing extractor must return schema-compliant JSON reliably. Which approach is preferred?
Select an answer to reveal the explanation.
Short Explanation
Hoping free-form chat text is valid JSON is like hoping a sticky note is a signed permit. Tool use plus a JSON schema makes the structured contract stick.
Full Explanation
A clerk filing extractor that must return schema-compliant JSON reliably should use tool_use with a JSON schema so outputs must satisfy the structured contract. Tool-mediated structured output binds field names and types at the API layer, which is far more dependable for municipal integrations than hoping chat text happens to be valid JSON. The schema becomes the machine-checkable interface between Claude and the clerk system of record.
Asking for free-form JSON inside ordinary assistant text with no tool contract fails because markdown fences, commentary, and slight key drift break parsers unpredictably. Accepting any prose paragraph and parsing with ad-hoc string splits fails conceptually: splits are brittle against wording changes and cannot enforce types or required keys. Disabling schemas and validating only by human eyeballing in chat fails at civic scale—eyeballing does not gate automated filing pipelines or provide reproducible acceptance criteria.
Exam caveat: tool_use plus schema enforces structure; it does not prove semantic correctness of extracted clerk values—pair with validation rules and sampling audits. Operational check: register an extraction tool with a strict JSON schema, require tool_use for filing jobs, and reject any assistant-only text path before writing to the clerk system of record.