query
Run read-only SQL SELECT queries on geospatial datasets with a sandboxed execution environment.
Instructions
Run one read-only SQL SELECT against accessible datasets.
Executes through the server's hardened SQL sandbox: a single SELECT over
data.* tables, an allowlisted function set (aggregates, math, string,
date, JSON, common PostGIS like ST_Area/ST_DWithin/ST_Intersects), and a
strict server-side budget (a few seconds of runtime, a repetition cap on
self-joins, and row_limit rows). Returns {columns, rows, row_count, truncated} with rows as lists in column order.
Requires credentials with AI-chat permission — anonymous configurations
cannot use this tool. Workflow: search_datasets to find a dataset, then
get_dataset_schema for its table_name and columns, then reference it
as data.<table_name> in the SQL and list the same table_name in
restrict_tables. Every table the query touches must be listed there;
the scope can only narrow what your credentials already see. Writes,
other schemas, and unlisted functions are rejected with a short reason.
Args:
sql: A single SELECT statement over data.* tables.
restrict_tables: Table names (no data. prefix) the query may touch.
Required and non-empty.
row_limit: Max rows to return (1-1000, default 100).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | ||
| row_limit | No | ||
| restrict_tables | Yes |