Skip to main content
Glama

Agent Spend Guard — owner-set purchasing guardrails

spend_guard_check_purchase

Humans: sign up with your email at https://a2awire.com/api-key and create an API key, then hand it to your agent (it sends Authorization: Bearer or X-API-Key with every call). Agents without an account: a reviewable bootstrap script is served at https://a2awire.com/api/v1/connectors/spend-guard/bootstrap.sh (download it, read it, then run it to mint a key). Call BEFORE checkout. Evaluate a proposed purchase (merchant, amount_usd) against the owner's spend rules and recent ledger. Returns a decision (approve, deny, or ask_user), a plain-English reason, the remaining monthly budget when a cap is set, and a check_id. deny means denylisted merchant or over the monthly cap; ask_user means above the per-purchase threshold or a possible duplicate of a purchase in the last 10 minutes. Optional tx_ref is your idempotency key for this purchase; pass the same value to spend_guard_record_purchase afterwards. Appends a check event; checks never consume budget. USD only (the currency argument is kept for forward compatibility; any other value is rejected). Not guest-callable. REST: POST /api/v1/spend-guard/check.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tx_refNoOptional idempotency key for this purchase; pass the same value to the record call afterwards. Checks are exempt from the uniqueness constraint that applies to recorded purchases.
categoryNo
currencyNoUSD only. Kept for forward compatibility; any other value is rejected.USD
merchantYes
amount_usdYes
descriptionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior5/5

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

The description adds meaningful behavior beyond the annotations: it appends a check event, never consumes budget, defines deny and ask_user semantics, states USD-only rejection, and describes authentication requirements. This is rich, non-obvious context that helps an agent reason about side effects.

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

Conciseness4/5

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

The description is dense but well organized: key operational guidance like 'Call BEFORE checkout' is placed early, followed by return values and behavioral rules. Some facts repeat the schema text, but almost every sentence adds operational value.

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?

With no output schema, the description adequately explains what the tool returns: decision, plain-English reason, remaining monthly budget when applicable, and check_id. It also covers auth, REST endpoint, idempotency linkage, and restrictions, giving an agent enough to call it correctly.

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?

Schema description coverage is only 33%, but the description adds value for merchant, amount_usd, tx_ref, and currency. However, category and description parameters are left undocumented in both schema and prose, so the description only partially compensates for the low coverage.

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?

The description uses a specific verb and resource: 'Evaluate a proposed purchase (merchant, amount_usd) against the owner's spend rules and recent ledger.' It also clearly differentiates this from sibling tools by describing the decision output and the later call to spend_guard_record_purchase.

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?

The description explicitly says 'Call BEFORE checkout' and clarifies the check-to-record flow with tx_ref. It also notes the tool is not guest-callable. It does not explicitly enumerate when to avoid report or set_rules, but the timing and purpose make the usage context clear.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources