After kicking off an async operation (e.g., $export, $evaluate-measure, $import) with Prefer: respond-async, capture the 202 Accepted response and extract the Content-Location header value
Implement a polling loop: GET Content-Location with headers Accept: application/json and optional Prefer: respond-async; inspect the response status code
On 202, parse the X-Progress header if present for a human-readable status string; apply exponential backoff (starting at a few seconds, capping at several minutes) to avoid server rate limiting
On 200, parse the completed response body for output file manifests (Bulk Data) or result resources (DEQM); process each output URL or result
On error status (4xx or 5xx), parse the OperationOutcome in the response body to determine whether the failure is retryable or terminal; log the error and the Content-Location URL for diagnostics
Known gotchas
Some servers return 200 with a still-in-progress indicator in the body rather than 202; always check both the HTTP status code and any status field in the response body before treating a 200 as completion
The Content-Location URL is typically valid only for the lifetime of the async operation and a short window afterward; failing to download output files before the server expires them results in data loss with no retry path
Polling too aggressively (e.g., sub-second intervals) may trigger server-side rate limiting or cause the operation to be cancelled; respect Retry-After headers when provided and default to at least 10-second intervals
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp