gtm_audit and org_audit run a multi-step pipeline
that can take from tens of seconds to several minutes. Rather than blocking, they return a
run id immediately, and you poll for the result.
Lifecycle
- Start — call the audit tool. It returns markdown with a run id and the polling instruction.
- Poll — call
get_run_statuswith the matchingkindand theid. - Finish — when
statusiscompleted, the poll returns the full result markdown. If itfailed, the status includes an error message.
Matching kind to tool
Using the wrong
kind for an id returns not found.
Polling guidance
- Poll on an interval — every 10–20 seconds is plenty. Avoid tight loops.
- Stop polling once status is
completedorfailed. - Run ids are scoped to your organization. Polling an id that belongs to another org returns
not found.