ctxQueryTraces
Query approval, enrichment, recipe-run, decision, and gate decision trails by trace type, time window, key, tag, or free-text search to explain why an event happened across sources.
Instructions
Unified query over approval / enrichment / recipe-run trails. Filter by traceType, time window, or natural key. Answers 'why did X happen' across sources.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| q | No | Case-insensitive substring search across the trace summary and serialized body. Use for free-form lookup when the key schema doesn't fit. | |
| key | No | Exact key match (sessionId:toolName / sha:ref / taskId). Substring match on the key; case-sensitive. | |
| tag | No | Restrict to decision traces carrying this tag (exact match, case-sensitive). Other trace types don't have tags and will be excluded when this filter is set. | |
| limit | No | Max results after filtering. Default 100. | |
| since | No | Only return traces with ts > this ms-epoch value. | |
| semantic | No | When true AND an embeddings endpoint is configured AND q is set, rank results by on-device semantic similarity instead of recency. Falls back to substring match when embeddings are unavailable. | |
| traceType | No | Optional filter — restrict to one source. Omit to get all. `gate_decision` = worker-autonomy gate decisions + their inputs. |