@@ -36,6 +36,11 @@ Response:
3636}
3737```
3838
39+ A listed ` inputSchema ` never has a root-level ` oneOf ` , ` anyOf ` or ` allOf ` ,
40+ because several LLM tool APIs reject tool input schemas with root combinators.
41+ Where the catalog schema has one, the server still enforces it when the tool is
42+ called, and the affected property descriptions state the constraint.
43+
3944The response includes an ` ETag ` and
4045` Cache-Control: private, max-age=300, must-revalidate ` . A request with a
4146matching ` If-None-Match ` receives ` 304 Not Modified ` .
@@ -135,11 +140,15 @@ and pagination are not identical to this summary tool.
135140
136141` query_sql ` , ` explain_query ` and other tools that run SQL internally parse the
137142statement with DataFusion's SQL parser and accept exactly one ` SELECT ` or ` WITH `
138- query. A trailing semicolon and trailing comments are allowed. Every ` SELECT `
139- projection, including those inside nested queries and set operations, must
140- name at most 10 explicit columns. ` * ` and ` table.* ` are rejected. Casts to
141- ` INT64 ` , ` UINT64 ` or ` FLOAT64 ` are rejected with a hint to use ` BIGINT ` or
142- ` DOUBLE ` . The statement is wrapped with an outer ` LIMIT 500 ` . ` sample_events `
143+ query. A trailing semicolon or trailing comments are allowed, but a semicolon
144+ followed by a comment passes validation and then fails when the query runs.
145+ The outermost projection must name at most 10 explicit columns, and ` * ` and
146+ ` table.* ` are rejected there. The same limit applies to each branch of a
147+ top-level set operation such as ` UNION ` and to a parenthesized outer query.
148+ Projections inside CTE definitions, derived tables and subqueries are not
149+ checked. Casts to ` INT64 ` , ` UINT64 ` or ` FLOAT64 ` anywhere in the statement are
150+ rejected with a hint to use ` BIGINT ` or ` DOUBLE ` . The statement is wrapped with
151+ an outer ` LIMIT 500 ` . ` sample_events `
143152returns at most 10 columns, choosing common observability fields such as
144153` p_timestamp ` , ` service.name ` , ` severity_text ` , ` body ` and ` trace_id ` before
145154other fields.
@@ -150,13 +159,25 @@ other fields.
150159datasets.
151160
152161` resolve_dataset ` accepts an optional ` telemetryType ` (` logs ` , ` metrics ` or
153- ` traces ` ) and ` limit ` (1–20, default 5). It resolves a ` selectedDataset ` or
154- ` contextDataset ` exactly, or resolves the only visible dataset. Otherwise it
155- ranks visible datasets by name match against ` query ` . It resolves only a
156- unique high-confidence name match. In every other case it returns
157- ` status: "ambiguous" ` with up to ` limit ` scored ` candidates ` , or ` "not_found" ` .
158- It never falls back to an arbitrary dataset. A selected dataset whose telemetry
159- type does not match ` telemetryType ` returns ` not_found ` .
162+ ` traces ` ) and ` limit ` (1–20, default 5). Its ` status ` is ` resolved ` ,
163+ ` ambiguous ` , ` not_found ` or ` error ` . Dataset names are matched
164+ case-insensitively.
165+
166+ - A ` selectedDataset ` or ` contextDataset ` resolves to the visible dataset with
167+ that name. If no visible dataset has that name, the result has
168+ ` status: "error" ` . If its telemetry type does not match ` telemetryType ` , the
169+ result is ` not_found ` .
170+ - Otherwise, if exactly one dataset is visible, it resolves to that dataset, or
171+ returns ` not_found ` if its telemetry type does not match.
172+ - Otherwise it scores the visible datasets that match ` telemetryType ` by name
173+ against ` query ` : 1000 if the name equals the query, 750 if the query contains
174+ the name, or 500 if the name contains the query, plus 25 for each query term
175+ longer than two characters that the name contains, plus 15 when
176+ ` telemetryType ` is given. It resolves only a unique top score of at least
177+ 500 . In every other case it returns ` ambiguous ` with up to ` limit ` scored
178+ ` candidates ` , or ` not_found ` if no visible dataset matches ` telemetryType ` .
179+
180+ It never falls back to an arbitrary dataset.
160181
161182` discover_datasets ` counts events in the requested range for each visible
162183dataset of the requested telemetry type that the caller can query. It returns
@@ -177,12 +198,23 @@ provided together. They take precedence over `minutes`.
177198
178199` get_log_context ` uses the same implementation as ` POST /api/v1/query/context ` .
179200Arguments must include exactly one of ` log ` , ` body ` or ` message ` , holding the
180- anchor row's exact value. The schema enforces this with ` oneOf ` , so calls with
181- none or more than one are rejected with ` 400 ` . If no context bounds are given,
182- the window defaults to ` contextWindow: "5 minutes" ` . Returned records keep at
183- most 10 fields per row, preferring ` p_timestamp ` , service, severity, message
184- and trace identifiers. The response also includes the anchor index, scope and
185- the executed queries.
201+ anchor row's exact value. The catalog schema enforces this with a root ` oneOf ` ,
202+ so calls with none or more than one are rejected with ` 400 ` . The listed
203+ ` inputSchema ` omits that ` oneOf ` (see [ List tools] ( #list-tools ) ) and states the
204+ rule in the property descriptions.
205+
206+ Context bounds are either ` contextWindow ` or both ` contextStartTime ` and
207+ ` contextEndTime ` . Giving only one explicit bound, or a window together with an
208+ explicit bound, is an error. If no bounds are given, the tool uses
209+ ` contextWindow: "5 minutes" ` . A window extends that duration on each side of
210+ ` pTimestamp ` , and both ends are rounded down to the minute; if they round to the
211+ same minute, the end is one minute after the start. Explicit bounds are used at
212+ millisecond precision without rounding, and ` pTimestamp ` must be at or after
213+ the start and before the end. ` pageSize ` is 1–500, default 100.
214+
215+ Returned records keep at most 10 fields per row, preferring ` p_timestamp ` ,
216+ service, severity, message and trace identifiers. The response also includes
217+ the anchor index, scope and the executed queries.
186218
187219## Trace activity
188220
@@ -211,14 +243,21 @@ dataset's time partition, or `p_timestamp` if none is configured. The dataset
211243must have traces telemetry and contain ` span_span_id ` and ` span_trace_id ` .
212244Unknown fields are rejected. ` span_count ` is ` COUNT(DISTINCT span_span_id) ` and
213245` trace_count ` is ` COUNT(DISTINCT span_trace_id) ` , so duplicate span rows are
214- not double counted. The result contains the exact executed SQL as ` query ` ,
215- along with ` bucketInterval ` , ` semantics ` and up to 500 ` rows ` . Clients can
216- rerun that SQL unchanged, for example in a dashboard tile.
246+ not double counted. Rows are ordered by bucket. The result contains ` query ` ,
247+ ` bucketInterval ` , ` semantics ` and up to 500 ` rows ` .
248+
249+ ` query ` is the aggregation SQL before the tool wraps it with ` LIMIT 500 ` . It
250+ has no time predicate: the time range comes from the request's ` startTime ` and
251+ ` endTime ` , which the query API rounds down to the minute. To reproduce the
252+ result, for example in a dashboard tile, run ` query ` through the query API with
253+ the same ` startTime ` and ` endTime ` .
217254
218255## Argument schema validation
219256
220257` inputSchema ` is enforced server-side for ` type ` (a single type or a list of types), ` required ` ,
221258` additionalProperties ` , ` enum ` , ` const ` , ` minLength ` /` maxLength ` ,
222259` minimum ` /` maximum ` , ` minItems ` /` maxItems ` , ` items ` , ` anyOf ` and ` oneOf ` .
223260` oneOf ` passes only when exactly one variant matches. Combinators are checked
224- in addition to sibling keywords; they do not replace them.
261+ in addition to sibling keywords; they do not replace them. Validation uses the
262+ catalog schema, including any root combinators omitted from the listed
263+ ` inputSchema ` .
0 commit comments