Skip to main content
Glama

Spend policy: agent payment rules check, plus a signed audit record

check_spend_policy

[Spend policy: agent payment rules check, plus a signed audit record] Check one proposed payment against the buyer's rules (per-tx limit, rolling cap with spent-so-far, categories, allow/deny lists, hours+timezone, assets/chains, human-approval threshold). Returns allow / deny / needs_approval, which rules fired, and a signed audit record (decisionReceipt). Verify free at POST /api/receipt/verify; public key at GET /.well-known/gw8-receipt-key (enabled should be true). Stateless, deterministic; not custody; does not move money. $0.02. Paid: $0.02 USDC on Base, paid in-band via x402 MCP (@x402/mcp; _meta "x402/payment"). Also at POST https://micro-saas-agent.onrender.com/api/spend/check.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "payment": "<payment>",
      "policy": "<policy>"
    },
    "name": "check_spend_policy"
  }
}

Input Schema

NameRequiredDescriptionDefault
passNoOptional GW8 day pass token (from buy_day_pass / POST /api/pass/day); skips per-call payment
policyYescurrency, perTxLimit, rollingCap {limit, spentSoFar, windowHours}, allowedCategories, blockedCategories, allowList, denyList, onUnlisted (deny|needs_approval), allowedHours {start, end, timezone, days}, allowedAssets, allowedChains, requireApprovalAbove
paymentYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the burden well: it discloses determinism, statelessness, no custody/money movement, the three possible outcomes plus fired rules, the signed decisionReceipt, free verification endpoint and public key, and the pricing (\$0.02 USDC on Base via x402 in-band). Gaps remain around failure modes (malformed policy, expired day pass) and receipt contents, but the behavioral picture is unusually rich.

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

Conciseness3/5

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

Front-loaded with the core purpose, but it is a dense run-on: the bracketed title repeats the title field, the price is stated twice (\$0.02 then again as paid USDC on Base), and parenthetical lists are packed into one paragraph. Every element is relevant, yet the redundancy and density cost clarity.

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 3-parameter tool with a nested policy object and no output schema, the description explains the return values (decision, fired rules, signed receipt) and how to verify the receipt, which is the main informational need. Missing are error/edge-case behavior and how partial or malformed policies are handled.

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 coverage is 67%, and the description compensates by naming the policy object's semantics (limits, rolling cap with spent-so-far, categories, allow/deny lists, hours+timezone, assets/chains, approval threshold) beyond the schema's prose. The day-pass parameter is only explained in the schema, and the payment object's fields are not elaborated in the description, so it adds meaning but not exhaustively.

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 and resource — checking one proposed payment against the buyer's rules — and enumerates the rule dimensions covered (per-tx limit, rolling cap, categories, allow/deny lists, hours, assets/chains, approval threshold). It clearly differentiates itself from siblings like check_seller_reputation or get_payment_rails by being a policy-evaluation tool that returns allow/deny/needs_approval plus a signed receipt.

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?

Implies the trigger clearly (one payment about to be made, evaluated against a policy) and adds useful scoping exclusions — 'stateless, deterministic; not custody; does not move money' — which tells the agent this is a pre-flight decision check, not a payment execution. It does not explicitly name when to prefer a sibling or state preconditions for the policy object's completeness, so it stops short of full routing guidance.

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.