aggregate
Compute exact counts, summaries, histograms, and grouped breakdowns over dataset rows without SQL, with optional CQL2-JSON filters and bounding-box constraints.
Instructions
Compute an exact aggregate over a dataset's rows: counts, summaries and
breakdowns without writing SQL. Use query for anything else.
request is the JSON body of the aggregate route, chosen by op. Every
op takes an optional CQL2-JSON filter and an optional bbox
[west, south, east, north] in WGS 84. Unknown keys are refused.
{"op": "count"}{"op": "stats", "column", "stats": [count|sum|avg|min|max, ...]}{"op": "value_counts", "column", "limit"}(limit 1-50, default 10){"op": "histogram", "column", "bins"}(bins 1-50, default 10){"op": "group_by", "group_column", "stat", "column"}or"stats": [{"stat", "column"}], plus optionaldate_bucket(day|week|month|year),sort_by,sortandlimit(1-50){"op": "rows", "columns": [up to 20], "sort_column", "sort", "limit", "cursor"}lists features a page at a time (limit 1-100, default 25), each with itsgidandbbox, never a geometry; pass the previous page'snext_cursorascursorunder the same sort.
Returns {op, result, approximate, cached}. Refusals keep the route's
HTTP status and a code in the error detail:
422
too_wide: thebboxview holds over 500,000 rows. Narrow the bbox or drop it.422
invalid_column,invalid_cursor,invalid_filter,no_geometry,query_timeout,query_data_error,result_too_large: fix the request and retry.429
query_busy(two aggregates already running for you) orquery_at_capacity: retry after 200-400 ms with jitter.503
query_unavailable: retry after theRetry-Afterdelay. Datasets you can't read answer 404. The route allows 10 requests a second.
Args: dataset_id: Dataset id with a feature table (not a raster). request: The aggregate body described above.
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": {
"dataset_id": "<dataset_id>",
"request": "<request>"
},
"name": "aggregate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| request | Yes | ||
| dataset_id | Yes |