Skip to main content
Glama

Check Before an Agent Wallet Pays — Spend Gate

spend_gate_check
Destructive

Spend Gate (PAID $0.001 USDC on Base via x402). Advisory payment assessment — no wallet signing or spending by the buyer: a real Provider Trust approval and price cap are mandatory; explicit package/history rejections block. Four distinct decision inputs vote pay-side/reject-side — provider_trust (Provider Trust verify_provider) and payload_safety (ScriptDocs vulnerability check, only when manifest_url names an npm/PyPI/crates package) — both vote with real verdicts via the fleet operator lane at $0 upstream toll, price_sanity (quote vs caller policy_cap_usdc or the v1 default cap table; cap-only in v1, no historical median), delivery_history (this host's OmniGate settlement/delivery ledger). Coherence = |Σ w·d| / Σ w with d=+1 pay-side, −1 reject-side, w=confidence; gate_pass requires a positive Provider Trust decision, a real within-cap quote, no explicit safety or delivery-history rejection, coherence ≥ 0.6, and a pay-side consensus. The verdict is advisory, not payment authorization. Paths with no data abstain (no_signal) and contribute nothing. Only on a gate pass does Jev review run (noul act probability + pay/reject/quarantine choice, model + token usage returned). Use for: vetting a payee/invoice immediately before an agent wallet pays it. Don't use when: you need an actual payment executed (this is a check, it moves no funds), a trading signal (use interfere), or a free lookup (there is none — unpaid calls return the payment challenge). Settlement to the canonical SML payTo on Base.

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": {
      "payee": "<payee>",
      "quoted_amount": "<quoted_amount>"
    },
    "name": "spend_gate_check"
  }
}

Input Schema

NameRequiredDescriptionDefault
payeeYesPayee domain (e.g. "api.example.com") and/or full endpoint URL the wallet is about to pay.
manifest_urlNoOptional package page URL (npmjs.com/package/…, pypi.org/project/…, crates.io/crates/…) for the payload_safety path.
quoted_amountYesQuoted amount in USDC the wallet is about to pay.
tool_categoryNoOptional category of the tool/service being bought (e.g. data_lookup, market_data, inference, compute). Selects the v1 default cap when policy_cap_usdc is omitted; when omitted entirely the cap table's "default" cap applies.
payment_headerNoBase64 X-PAYMENT EIP-3009 payload (standard rail) for $0.001 USDC on Base.
wallet_addressNoAgent wallet address (informational).
payment_tx_hashNoBase USDC tx hash (sovereign rail) paying $0.001 to the canonical SML receiver.
policy_cap_usdcNoOptional caller policy cap in USDC; overrides the v1 default cap table for price_sanity.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / payment_header / description
      Previous value: -"Base64 X-PAYMENT EIP-3009 payload (standard rail) for $0.005 USDC on Base."New value: +"Base64 X-PAYMENT EIP-3009 payload (standard rail) for $0.001 USDC on Base."
    • changedInput schema / properties / payment_tx_hash / description
      Previous value: -"Base USDC tx hash (sovereign rail) paying $0.005 to the canonical SML receiver."New value: +"Base USDC tx hash (sovereign rail) paying $0.001 to the canonical SML receiver."
  2. Changed2 schema fields changed
    • changedInput schema / properties / tool_category / description
      Previous value: -"Category of the tool/service being bought (e.g. data_lookup, market_data, inference, compute). Selects the v1 default cap when policy_cap_usdc is omitted."New value: +"Optional category of the tool/service being bought (e.g. data_lookup, market_data, inference, compute). Selects the v1 default cap when policy_cap_usdc is omitted; when omitted entirely the cap table's \"default\" cap applies."
    • changedInput schema / required
      Previous value: -[
      -  "payee",
      -  "quoted_amount",
      -  "tool_category"
      -]New value: +[
      +  "payee",
      +  "quoted_amount"
      +]
  3. Added

TDQS

A4.4/5.0
Behavior4/5

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

Annotations declare destructiveHint=true, readOnlyHint=false and openWorldHint=true; the description goes well beyond them by disclosing the $0.001 x402 toll, the internal decision rules (positive Provider Trust decision, within-cap quote, no explicit rejection, coherence ≥ 0.6, pay-side consensus), the abstain-on-no-signal behavior, and that noul review runs only after a pass. One tension remains: 'no wallet signing or spending by the buyer' and 'it moves no funds' sits awkwardly beside the required payment_header signature / payment_tx_hash and destructiveHint=true, even though the '(PAID $0.001 USDC)' opener and 'unpaid calls return the payment challenge' partially correct it.

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?

The payment model and purpose are front-loaded, but the body is a dense jargon run — weights, coherence formula, upstream toll, lane names — that does more to explain internals than to help select or invoke the tool. The decision-relevant 'Use for / Don't use when' block is buried at the end, and several clauses could be cut without losing agent-actionable information.

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?

With no output schema, the description usefully characterizes the result (a gate_pass verdict with named preconditions, plus Jev's probability/choice/model/token usage on pass) and the payment-challenge failure mode. For an 8-parameter paid tool, what an agent needs to invoke it correctly is essentially present; only the exact verdict field names remain unspecified.

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 100%, so baseline is 3, but the description adds interaction semantics the schema does not: manifest_url is only consumed by the payload_safety path and only for npm/PyPI/crates package URLs, price_sanity reads policy_cap_usdc or falls back to the v1 default cap table, and payment_header vs payment_tx_hash correspond to the standard and sovereign rails. These are real cross-parameter meanings, not restatements.

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 first line names a concrete verb and resource — an advisory pre-payment assessment of a payee — and the mid-section pins down what it produces (a coherence-weighted gate verdict plus a Jev review on pass). It explicitly separates itself from siblings by naming 'interfere' for trading signals and by stating that payment execution is not this tool, so an agent can route without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit 'Use for: vetting a payee/invoice immediately before an agent wallet pays it' and an equally explicit 'Don't use when:' block covering payment execution, trading signals (pointing to interfere), and free lookups. That covers when, when-not, and two alternatives by name.

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