Skip to main content
Glama
SPR (Sealed Payment Record)

SPR (Sealed Payment Record)

Official

record_settlement

Idempotent

Seals successful payments as signed, verifiable records: matches each to its intent, checks cap and expiry, and rejects conflicting facts unless a correction is supplied.

Instructions

Call this right after each payment succeeds, with the rail's own reference (a merchant calls it for each payment received, with direction inflow). Records the payment: sealed, matched to its intent, checked against its cap and expiry. The same payment again returns unchanged. Different facts for a payment already sealed return conflict and seal nothing, unless you give correction: { reason }.

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": {
      "rail": "<rail>",
      "source_id": "<source_id>",
      "amount_minor": "<amount_minor>",
      "currency": "<currency>",
      "occurred_at": "<occurred_at>"
    },
    "name": "record_settlement"
  }
}

Input Schema

NameRequiredDescriptionDefault
memoNo
railYes
nonceNo
stateNo
networkNoOptional: the network it settled on, such as base or solana
receiptNoOptional: where the receipt or invoice is kept, and its hash; never the receipt itself
currencyYes
order_idNoOptional: the merchant's order ID for this payment, as the merchant shows it (on the receipt or order confirmation)
buyer_keyNoThe buyer's public key, to check buyer_intent
directionNo
intent_idNo
source_idYesThe rail's own reference: transaction hash, charge ID
correctionNoOnly to correct a payment already sealed: the new version says why
invoice_refNoOptional: the invoice or bill number this payment paid, as given to check_payment
occurred_atYesWhen the rail says the payment was made, in ISO 8601 with its offset (2026-10-28T19:00:00Z or 2026-10-28T12:00:00-07:00)
amount_minorYes
buyer_intentNoFor a merchant recording a payment it received: the buyer's own sealed intent ({ payload, seal }) as the buyer's agent presented it at checkout. It must check with buyer_key; the record keeps its hash and whether the payment was inside it
counterpartyNo
evidence_typeNoOptional: onchain for a blockchain transaction, provider_reference for a payment provider's reference
counterparty_idNoOptional: how the payee is identified, as scheme:value, such as domain:data.example or wallet:0x…
counterparty_typeNoOptional: organization, person, service or agent
settlement_providerNoOptional: who settled the payment, such as the x402 facilitator
buyer_authenticationNoOptional: how the buyer proved it was them at checkout. Never the evidence itself
processor_transaction_idNoOptional: the payment processor's own transaction ID (Stripe, Adyen, the acquirer), where it differs from source_id. Both can be added later to a record already sealed

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv0.1.2
    • addedInput schema / properties / buyer_authentication
      Added value: +{
      +  "description": "Optional: how the buyer proved it was them at checkout. Never the evidence itself",
      +  "properties": {
      +    "at": {
      +      "type": "string"
      +    },
      +    "eci": {
      +      "type": "string"
      +    },
      +    "method": {
      +      "enum": [
      +        "3ds",
      +        "passkey",
      +        "network_token",
      +        "otp",
      +        "agent_mandate",
      +        "other"
      +      ],
      +      "type": "string"
      +    },
      +    "provider": {
      +      "type": "string"
      +    },
      +    "reference": {
      +      "description": "The authentication's own reference, such as the 3-D Secure transaction ID",
      +      "type": "string"
      +    },
      +    "result": {
      +      "description": "authenticated, attempted, failed and so on",
      +      "type": "string"
      +    },
      +    "sha256": {
      +      "description": "The SHA-256 of the authentication evidence, kept elsewhere",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "method",
      +    "result"
      +  ],
      +  "type": "object"
      +}
    • addedInput schema / properties / buyer_intent
      Added value: +{
      +  "description": "For a merchant recording a payment it received: the buyer's own sealed intent ({ payload, seal }) as the buyer's agent presented it at checkout. It must check with buyer_key; the record keeps its hash and whether the payment was inside it",
      +  "properties": {
      +    "payload": {
      +      "type": "object"
      +    },
      +    "seal": {
      +      "type": "object"
      +    }
      +  },
      +  "required": [
      +    "payload",
      +    "seal"
      +  ],
      +  "type": "object"
      +}
    • addedInput schema / properties / buyer_key
      Added value: +{
      +  "description": "The buyer's public key, to check buyer_intent",
      +  "properties": {
      +    "entity": {
      +      "type": "string"
      +    },
      +    "public_pem": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "public_pem"
      +  ],
      +  "type": "object"
      +}
    • addedInput schema / properties / invoice_ref
      Added value: +{
      +  "description": "Optional: the invoice or bill number this payment paid, as given to check_payment",
      +  "type": "string"
      +}
    • addedInput schema / properties / order_id
      Added value: +{
      +  "description": "Optional: the merchant's order ID for this payment, as the merchant shows it (on the receipt or order confirmation)",
      +  "type": "string"
      +}
    • addedInput schema / properties / processor_transaction_id
      Added value: +{
      +  "description": "Optional: the payment processor's own transaction ID (Stripe, Adyen, the acquirer), where it differs from source_id. Both can be added later to a record already sealed",
      +  "type": "string"
      +}
  2. First observedv0.1.0

TDQS

A4/5.0
Behavior5/5

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

Beyond idempotentHint=true, the description spells out the actual semantics: repeat submissions return unchanged, differing facts against a sealed record return conflict and seal nothing, and correction requires a reason. That is behavior an annotations-only reader could not infer, and it is consistent with destructiveHint=false.

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?

Four dense sentences, front-loaded with the call trigger and followed by the idempotency and conflict rules in priority order. The mid-sentence parenthetical is slightly awkward but carries required information, and nothing is filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 24-parameter mutation with no output schema, the description never says what a successful call returns (sealed record identifiers, verdict of the cap/expiry check) or how a cap/expiry failure surfaces. The core write, idempotency, and correction paths are complete, but the response contract is absent.

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?

The description adds real meaning for `correction` ({ reason }), `direction` (inflow for received payments), and `buyer_intent` (must check against buyer_key), but with 24 parameters and 63% schema coverage, the many optional evidence/counterparty fields are left entirely to the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/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 ('Records the payment') and adds concrete mechanics: sealing, matching to its intent, cap and expiry checks. It doesn't explicitly name a sibling (e.g., record_intent vs check_payment), so the agent must infer the boundary from the wording rather than being routed.

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?

'Call this right after each payment succeeds' plus the parenthetical clarifies the caller (merchant) and the direction (inflow). The conflict/correction clause effectively states when not to submit changed facts and what the alternative is, but no sibling tool is named as a substitute for other cases.

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