Skip to main content
Glama
mcpsmiths

cost-guard-mcp

by mcpsmiths

estimate_query_cost

Read-only

Estimate the cost of a SQL query before running it to avoid unexpected warehouse charges. Check the accuracy tier before trusting the estimate for BigQuery, Snowflake, or Databricks.

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).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYes
engineYes
warehouseNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
engineYes
caveatsNo
currencyNoUSD
accuracy_tierYes
estimated_bytesNo
estimated_cost_usdNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations cover safety (readOnlyHint, openWorldHint), and the description adds genuine behavioral value by decoding the response's accuracy_tier vocabulary (PRECISE/UPPER_BOUND/HEURISTIC) so the agent knows how much to trust the result. It does not disclose latency, rate limits, or failure modes, so it stops short of a 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?

Three tight sentences, front-loaded with the core action, then the usage rule, then the interpretation key. Every sentence carries distinct information with no filler.

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

Completeness4/5

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

For a read-only estimation tool with an output schema present, the description supplies the two things an agent most needs: when to call it and how to interpret accuracy_tier. The only gap is guidance on the optional warehouse argument, which is minor given the overall coverage.

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

Parameters2/5

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

Schema description coverage is 0% and there are three parameters, yet the description says nothing about sql, engine, or warehouse semantics. The engine enum values are self-explanatory, but the optional warehouse parameter and what it selects are unexplained in both schema and description.

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+resource ('Estimate the cost of a SQL query') with a clear temporal scope ('before running it'). An agent can distinguish it from run_query_bounded (which executes) and describe_engine_capabilities (which describes) without opening a schema.

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?

Explicitly prescribes when to call it ('ALWAYS call this before running an expensive-looking query'), giving a clear precondition. It does not name the sibling run_query_bounded as the follow-up action, so the routing is implied rather than spelled out.

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