estimate_query_cost
Estimate SQL query cost before execution to avoid overspending. Provides precision-tiered dollar estimates for BigQuery, Snowflake, and Databricks, enabling informed decisions on expensive queries.
Instructions
Estimate the cost of a SQL query before running it. ALWAYS call this before running an expensive-looking query. The response's accuracy_tier tells you how much to trust the number: PRECISE (exact), UPPER_BOUND (real cap, may overstate), HEURISTIC (rough).
warehouse_size (Snowflake/Databricks only, e.g. "SMALL", "X-Large") and edition
(Snowflake only, e.g. "enterprise") default to the smallest/standard tier if omitted —
set them to match the warehouse you actually run this query on, or the dollar figure
will understate cost on a larger warehouse.Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | ||
| engine | Yes | ||
| edition | No | ||
| warehouse | No | ||
| warehouse_size | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| engine | Yes | ||
| caveats | No | ||
| currency | No | USD | |
| accuracy_tier | Yes | ||
| estimated_bytes | No | ||
| estimated_cost_usd | No |