Skip to main content
Glama

Agent Spend Guard — owner-set purchasing guardrails

spend_guard_record_purchase

Idempotent

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 AFTER checkout. Record a completed purchase in the owner's spend ledger. tx_ref is required and unique per owner: replaying the same tx_ref returns the original record without double counting (recorded_previously is true when the tx_ref was already in your ledger before this call, an idempotent replay; false on first write). Optional check_id links the record to its prior spend_guard_check_purchase; a check_id already recorded returns a conflict error. Returns the recorded event and the month-to-date total. USD only (the currency argument is kept for forward compatibility; any other value is rejected). Not guest-callable. REST: POST /api/v1/spend-guard/record.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tx_refYesCaller idempotency key, unique across your recorded purchases; replays return the original record.
categoryNo
check_idNoOptional id from spend_guard_check_purchase; at most one record may consume each check.
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.7/5.0
Behavior5/5

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

Annotations only provide idempotentHint=true, but the description adds extensive behavioral detail: idempotent replay semantics with recorded_previously, conflict error for used check_id, currency rejection, authentication requirements, return of recorded event and month-to-date total, and REST endpoint. This far exceeds what annotations convey and is essential for correct usage.

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?

The description is long but every sentence adds value. It front-loads authentication requirements and timing, then core function, idempotency, optional linking, return value, currency constraint, and REST endpoint. The structure is logical and no filler is present.

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?

For a tool with 7 parameters and no output schema, the description is thorough: it covers authentication, when to call, idempotency, optional link conflicts, currency restriction, return values, and the REST path. An agent has all necessary information to call it correctly without external docs.

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

Parameters4/5

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

Schema description coverage is only 43%, but the tool description compensates by explaining the critical parameters: tx_ref uniqueness and idempotency, check_id linking behavior, and currency restriction. The schema also provides descriptions for tx_ref, check_id, and currency, and the description reinforces them. Parameters like merchant and amount_usd lack individual description but their purpose is self-evident from the schema constraints.

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 states a specific verb ('record'), a resource ('completed purchase in the owner's spend ledger'), and a clear temporal constraint ('Call AFTER checkout'). It is unambiguous and naturally distinguishes from sibling tools by its role in the purchase flow, even without naming them.

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 AFTER checkout' and mentions linking to 'prior spend_guard_check_purchase', which implies the sequencing versus the check tool. It also notes 'Not guest-callable' as a precondition. It does not explicitly name alternatives for when not to use, but the flow context is sufficient.

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