Skip to main content
Glama

Estimate BigQuery query cost

estimate_query_cost
Read-onlyIdempotent

Calculate BigQuery query cost before running it by performing a free dry run that reports bytes processed, estimated on-demand USD charges, and flags SELECT * or missing partition filters.

Instructions

Runs a BigQuery dry run (free; no data is read or billed) for the given standard SQL and returns bytes processed, the estimated on-demand cost in USD, and warnings such as SELECT * usage or missing filters on partitioned tables.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesBigQuery standard SQL query to estimate, e.g. SELECT ... FROM ...

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnly/openWorld/idempotent, so the bar is lower, yet the description adds real value beyond them: the dry run is free and reads/bills no data, and it enumerates what comes back (bytes processed, USD estimate, warnings). It does not mention permission requirements or rate limits, so not a full 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single sentence with the core action, the cost constraint, and the return payload front-loaded. No filler and no redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema exists, so the description must cover returns, and it does (bytes processed, cost in USD, warnings like SELECT * or missing partition filters). Combined with annotations carrying the safety profile, an agent has everything needed to invoke and interpret it.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Only one parameter exists and schema description coverage is 100%, so the schema already documents the `sql` field. The description's restatement ('for the given standard SQL') matches, not exceeds, that documentation. Baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Runs a BigQuery dry run ... for the given standard SQL') and immediately scopes the outcome (bytes processed, estimated cost, warnings). No siblings exist, so no differentiation is needed, and the tool's function is unmistakable.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Clearly conveys the context for use: estimate cost before an actual query, and the dry run is free. It stops short of explicit when-not guidance (e.g., non-standard SQL, unsupported statements), but there are no siblings to route between.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools