select
Select a subset of entities with a CEL selection expression — the
composable way to filter across types, attributes, and observation
thresholds with boolean logic, and (with project/order_by) return
ranked computed columns in ONE call instead of a per-entity fan-out.
Examples:
entity.type == 'Well' && entity.state.status in ['active','injection']
entity.type == 'Well' && has_obs(entity,'gas_rate') && latest(entity,'gas_rate') < 50000
avg(entity,'water_cut','30d') > 80
Functions: has_obs(entity,prop), latest(entity,prop),
avg|min|max|sum|count(entity,prop,window), search(entity,text),
related(entity,rel[,'inbound']) (neighbour-id list; size(...) counts
them — use 'inbound' to count entities pointing AT this one, e.g.
size(related(entity,'subject','inbound')) for interventions targeting a
well), derived(entity,prop) (a derived_from state value, so you can rank
by a computed metric — order_by="derived(entity,'constraint_ratio')").
Guard any observation/maybe-missing-field predicate (has_obs/has(...)).
`project` = {column: cel_expr} computes a scalar per matched entity onto
each result's `computed` (e.g. {"gas_rate":"latest(entity,'gas_rate')",
"defects":"size(related(entity,'defects'))"}). `order_by` = a projection
column name or its own cel_expr; `descending` reverses it; `limit` then
keeps the top N. So "rank the wells feeding pipeline X by current gas
rate, with defect counts" is a single select, not 3N calls. `types`
narrows the scan (else inferred from the expression). `format`
(json|tsv|md, default json) applies to this list result only: tsv/md
return the rows (including any projected columns) as a compact table.Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"expression": "<expression>"
},
"name": "select"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| types | No | ||
| format | No | json | |
| project | No | ||
| order_by | No | ||
| descending | No | ||
| expression | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||