Search or aggregate through an adapter
liquid_queryRun server-side search or aggregation on any connected API and receive only the answer, not the full payload. Reduces token usage by returning filtered results or summaries.
Instructions
Run a server-side search or aggregation through an adapter and get just the answer instead of the full payload — deterministic, no LLM call, read-only. Two modes: set group_by/agg to aggregate (counts, sums, …), or where/fields/limit to filter and project. Side effects: a read-only outbound HTTP(S) request to the connected API, rate-limited like liquid_fetch. Returns search results {records, data, _meta} or an aggregation {result, _meta}. Prefer this over liquid_fetch whenever you only need a filtered slice, a count, or a summary — it returns far fewer tokens.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| adapter_id | Yes | An adapter id returned by liquid_connect (or listed by liquid_list_adapters). | |
| endpoint | No | Optional endpoint path to act on (e.g. "/users"); defaults to the adapter's primary endpoint. Use a path shown by liquid_connect / liquid_list_adapters. | |
| where | No | Search-mode filter as field -> value (or field -> {op: value}), e.g. {"status": "active", "price": {"gt": 100}}. Keys are target_model fields. | |
| fields | No | Search-mode projection: target_model field names to return, e.g. ["name", "price"]. Omit for all fields. | |
| limit | No | Search-mode max records to return (default 100). | |
| group_by | No | Aggregate-mode: target_model field to group by, e.g. "category". | |
| agg | No | Aggregate-mode: aggregations per group as field -> op, e.g. {"price": "sum", "id": "count"}. Provide together with group_by. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| records | No | Search mode: number of records. | |
| data | No | Search mode: matching records (capped at 100). | |
| result | No | Aggregate mode: the grouped/aggregated result. | |
| _meta | No | Call metadata: adapter_id, service, endpoint, latency_ms (and records when applicable). | |
| error | No |