spendguard-mcp

v0.1.1
spendguard-mcp Checked 1 day ago Published 2 months ago

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

ParameterTypeDescription
engine *string

estimate_query_cost

Pre-flight dollar estimate for SQL. Free, never executes the query.

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

ParameterTypeDescription
engine *string
sql *string
confirmation_token
max_estimated_cost_usd
max_rowsinteger
warehouse

spend_report

Reconciled spend per engine over the period, plus calibration state.

ParameterTypeDescription
period_daysinteger

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

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

ParameterTypeDescription
engine *string
sql *string