A permitting API returns JSON that Claude tools must consume. What engineering practice fits?
Select an answer to reveal the explanation.
Short Explanation
Municipal APIs send surprises. Parse that permitting JSON like a skeptic—validate shape before Claude's tools trust it.
Full Explanation
Permitting APIs that return JSON Claude tools must consume require defensive parsing of permitting JSON schemas in the Claude tool layer. That engineering practice works because municipal payloads vary, version, and occasionally violate happy-path assumptions: validating types, required fields, and HTTP status before handing data to Claude prevents brittle tool failures and stops malformed content from being treated as authoritative permit facts. Defensive parsing also enables clear error messages back to planners when the upstream permitting service is degraded. Validating permitting JSON schemas at the API gateway ingress fails by concept: enforcement at the gateway does not protect the Claude tool layer that actually consumes the JSON, so malformed or transformed payloads can still reach Claude and cause crashes or wrong answers. Formatting permitting JSON payloads for clear Claude prompt presentation fails by concept: it concerns display layout rather than defensive consumption, so it does not validate types, required fields, or HTTP status before Claude relies on the data. Caching permitting JSON responses in the Claude tool memory store fails by concept: caching stores responses for reuse but does not parse or validate schemas, HTTP status, or required fields before Claude consumes them, so stale or error bodies can still be treated as permit records. Exam caveat: schema validation should tolerate documented optional fields and version negotiation, not reject every additive change, and sensitive permittee data must still be redacted according to city policy before logging. Operational check: feed the Claude tool layer fixtures for 200 valid JSON, 200 with missing required fields, and non-2xx responses; assert only validated successes become tool results and that failures surface structured errors without silent prompt injection of raw error HTML.