preview_query
Preview SQL queries to assess safety, intent, and cost before execution, with automatic LIMIT applied.
Instructions
Dry-run a query through the full safety + intent pipeline.
Returns:
Safety verdict (SAFE / BLOCKED with reason)
Intent analysis (interpreted intent, assumed filters, ambiguity warnings)
EXPLAIN cost estimate (PostgreSQL only)
Final SQL with auto-LIMIT applied
For bare SELECT * queries on large tables, Bollard will automatically redirect to profile_table to give the AI richer context with fewer tokens.
The editor AI should call this before execute_query for any non-trivial query.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | SQL statement to preview. | |
| connection | Yes | Database alias (from connect_database). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |