spendguard-mcp
v0.1.1Spend governor for AI agents running SQL on data warehouses: pre-flight cost estimates, estimate-vs-actual ledger, budgets with teeth, and cheaper-query…
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
describe_engine_capabilities
What cost signals an engine supports and how much to trust them. Call this first: it bakes the honesty contract in before any estimate.
| Parameter | Type | Description |
|---|---|---|
engine * | string |
estimate_query_cost
Pre-flight dollar estimate for SQL. Free, never executes the query.
| Parameter | Type | Description |
|---|---|---|
engine * | string | |
sql * | string | |
warehouse |
run_query_bounded
Run SQL only if it passes every guardrail; reconcile actuals after. Flow: estimate -> budget gate (caps / anomaly / human confirm) -> execute with row cap -> fetch actual billed cost -> train ledger calibration. If a human confirmation is required, the response includes a single-use token (5-min TTL): show the estimate to the human, then call again with confirmation_token set.
| Parameter | Type | Description |
|---|---|---|
engine * | string | |
sql * | string | |
confirmation_token | ||
max_estimated_cost_usd | ||
max_rows | integer | |
warehouse |
spend_report
Reconciled spend per engine over the period, plus calibration state.
| Parameter | Type | Description |
|---|---|---|
period_days | integer |
set_budget
Persist a spend cap. name: daily | session (scope: day | session). Examples: set_budget("daily", "day", 50.0), set_budget("session", "session", 10.0).
| Parameter | Type | Description |
|---|---|---|
max_cost_usd * | number | |
name * | string | |
scope * | string |
suggest_cheaper_query
Concrete cheaper rewrites for expensive-looking SQL (LIMIT injection, partition-filter templates, SELECT * guidance, cross-join flags).
| Parameter | Type | Description |
|---|---|---|
engine * | string | |
sql * | string |