Skip to main content
Glama

Record x402 payment

spend_record
Idempotent

0.005 USDC per call via x402, no key (unpaid call returns PaymentRequired; retry with params.meta["x402/payment"]). Record an x402 payment the agent made (or update a reserved one by spendId/ref): status settled|failed|pending|refunded, tx; verify:true checks a Base tx on-chain (read-only). Builds the spend log / receipts. Needs a key mts (X-API-Key header or apiKey argument). No key? call settle_trial_key (free, 50 calls/7 days). Full plan 1 USDC/30d incl. 1,000 calls via x402.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "spend_record"
  }
}

Input Schema

NameRequiredDescriptionDefault
txNoSettlement tx hash on Base, 0x + 64 hex.
refNoYour order / request id (idempotency key).
hostNoSeller hostname, e.g. api.example.com.
noteNoFree-text note (max 200 chars).
payToNoSeller receiving address 0x….
payerNoPayer / agent wallet address 0x… (40 hex).
apiKeyNoYour MoneyTools Settle key mts_… (alternative to the X-API-Key header). No key: call settle_trial_key.
statusNoNew status (see tool description).
verifyNotrue = verify tx on Base (read-only).
networkNoCAIP-2 network, default eip155:8453 (Base).
spendIdNoSpend id sp_… from spend_check reserve.
amountUsdNoUSD amount as decimal string, e.g. "0.25".
sessionIdNoYour session / run id.
paymentRequiredNoThe 402 PAYMENT-REQUIRED header (base64) or the 402 JSON body.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior5/5

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

Goes well beyond the annotations: discloses the 0.005 USDC x402 charge per call, that an unpaid call returns PaymentRequired and must be retried with params._meta["x402/payment"], that verify:true performs a read-only Base on-chain check, and that an mts_ key is required via header or apiKey argument. That is exactly the operational context (payment gating, auth, side-effect scope) an agent needs before invoking a mutating tool.

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?

Opens with pricing rather than purpose, and the trailing upsell ('Full plan 1 USDC/30d incl. 1,000 calls via x402') is promotional rather than functional. The substantive content is dense with nested parentheses, making the essential instruction harder to extract than it needs to be.

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?

With 14 parameters and zero required, the description never states which combinations are valid (spendId vs tx vs paymentRequired vs ref as idempotency key) — the central ambiguity for an agent deciding what to supply. Auth and payment mechanics are fully covered and no output schema exists, so the remaining gap is specifically about parameter composition.

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 the baseline is 3, but the description adds real value by enumerating the legal status values (settled|failed|pending|refunded), which the schema dodges with a circular 'see tool description' reference. It also clarifies tx and verify semantics in context, though it does not explain how the 14 optional params combine.

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: 'Record an x402 payment the agent made (or update a reserved one by spendId/ref)'. The spendId linkage to spend_check reserve distinguishes it from spend_log and receipt_create, and the object being written (spend log / receipts) is named.

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?

Gives clear use conditions (record a payment already made, or update a previously reserved one via spendId/ref) and an explicit fallback path when unauthenticated ('No key? call settle_trial_key'). It stops short of explicitly separating itself from receipt_create/spend_log, which also sound like they write spend/receipt data.

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