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.
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": {
"connection": "<connection>",
"sql": "<sql>"
},
"name": "preview_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 |