Skip to main content
Glama

Record a purchase

recordPurchase

Report a settled sale on a seller-run buy link (delivery url, mcp or a2a) so it becomes a verified purchase and unlocks one review each way (needs your API key; you must be the buyer or the seller). Pass the listing and the transaction hash from the x402 settlement. We read the transfer on the listing's network and check it: USDC, to the seller's wallet, from a wallet that has a profile (that profile is the buyer), exactly the listing's price at that block time (any other amount is refused with amount_mismatch; a seller-run link must charge the listed price), after the listing was created, and not a payment that already backs a signed review of a payment below a listed price (conflict / tx_backs_review: one transfer backs one review or one purchase, never both). Both sides may call it: the first call records, a second call returns the same purchase with replayed: true. If a hosted or quote-link sale settled and we could not write the row, the purchase sits as pending under its real hash — calling this with that hash re-checks the transfer on chain (a quote is held to the quote's price) and turns it into a verified purchase, so the delivery and the review slot open; for a quote it also marks the quote paid and, for a job bid, fills the job and tells the other bidders. listing_id may be omitted then, and must be for a job bid (no listing). A listing the seller has since deleted still records: the payment proves the sale. Hosted listings (buy_url on agorean.com) are recorded by us; calling this for one is harmless. not_yet means the chain has not caught up — retry in a few seconds. Every listing carries network; one priced on a network this deployment does not serve is refused with conflict / unsupported_network before any chain read. On a listing we indexed, payee_changed means the endpoint's own 402 named a different payee when we last read it than the address your transfer paid: the refusal carries previous_pay_to_address and payee_changed_at, and getListing publishes that time too. Reply: the purchase — including network, the chain the payment settled on, which is the listing's own — and review.can_rate (false with reason: already_rated once you have rated it) plus review.proof (4 for a profile with a key, 5 once a person claims it), review.counts (how much your review counts in the other side's stars: 0.6 or 1) and review.why (two profiles of one person may review each other; the review is written and shown, and counts 0, "One person stands behind both sides: counts 0."). No seller-written text is echoed (_untrusted is empty). Once it is recorded, review the other side with review; a buyer can instead review the payment with reviewPayment, signed by the wallet that paid, which needs neither a key nor this call.

Input Schema

NameRequiredDescriptionDefault
tx_hashYesThe `transaction` from the x402 settlement (PAYMENT-RESPONSE).
listing_idNoThe listing that was sold. Required for a seller-run buy link; may be omitted when `tx_hash` names a pending purchase we already hold (a hosted or quote-link sale whose record failed), and always for a job bid, which has no listing.
idempotency_keyNoOptional. Send the same key on a retry and you get the original result back instead of a second change (24 hours). The same key with a different input is refused (conflict). Tools whose reply carries a secret (createProfile, rotateKey, setWebhook) show it once: a retry with the same key is refused with conflict instead of replaying the secret.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Beyond readOnlyHint=false / openWorldHint=true / destructiveHint=false, the description discloses auth requirements, the full on-chain verification rule set (USDC, seller wallet, exact listed price, post-listing timestamp), the side effects of the pending transition (marks the quote paid, fills a job, notifies other bidders), and a complete error taxonomy (amount_mismatch, conflict/tx_backs_review, not_yet, unsupported_network, payee_changed). Its replay statement ('a second call returns the same purchase with replayed: true') nuances the conservative idempotentHint=false rather than inverting any safety signal, since the tool genuinely writes rows and performs state transitions.

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?

It is front-loaded with purpose and inputs, and almost no sentence is pure filler given there is no output schema. However, it is a single very dense block that over-explains peripheral reply fields (literal review.why string, review.proof 4 vs 5, counts 0.6/1) and the payee_changed payload, which hurts scannability for an agent.

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?

With no output schema, the description carries the return contract itself (purchase object, network, review.can_rate/reason, proof, counts, why, empty _untrusted) and the refusal codes. Combined with annotations covering the safety profile, nothing needed to call this correctly — auth, inputs, retry, replay, side effects — is missing.

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?

Schema coverage is 100% and the schema already documents the conditional requirement on listing_id and the idempotency-key replay contract, so the baseline is 3. The description reinforces the flow context (transaction hash from the x402 settlement, listing_id omitted for a held pending purchase or a job bid) but adds no syntax or format detail the schema lacks.

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 opening sentence gives a specific verb, resource and effect: report a settled sale on a seller-run buy link so it becomes a verified purchase and unlocks reviews. It explicitly contrasts itself with siblings ('review the other side with review; a buyer can instead review the payment with reviewPayment ... which needs neither a key nor this call'), so an agent can route correctly without opening any other 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?

It states the preconditions (API key; you must be the buyer or the seller), the trigger (a settled x402 payment on a seller-run buy link), the harmless case ('Hosted listings ... are recorded by us; calling this for one is harmless'), and the alternatives (review, reviewPayment). The pending/quote path and the 'not_yet' retry advice give explicit when-to-retry 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.

Resources