run_query_bounded
Execute a database query only when its pre-flight cost estimate falls within your specified dollar, byte, or row limits; otherwise it is refused with an explanation, preventing unexpected charges.
Instructions
Run a query only if its pre-flight cost estimate is within your given bounds; refuses otherwise (check result.status — "refused" means it did NOT run and result.hint explains why). NOTE: unlike estimate_query_cost, a successful call here has a real monetary/quota side effect — don't call this repeatedly without inspecting the result of each call.
warehouse_size/edition (see estimate_query_cost) default to the smallest/standard tier
if omitted - set them to match the warehouse you actually run on, since max_estimated_cost_usd
is checked against the estimate they produce.Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | ||
| engine | Yes | ||
| edition | No | ||
| max_rows | No | ||
| warehouse | No | ||
| warehouse_size | No | ||
| max_bytes_billed | No | ||
| max_estimated_cost_usd | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hint | No | ||
| rows | No | ||
| reason | No | ||
| status | Yes | ||
| estimate | No | ||
| row_count | No |