Skip to main content
Glama

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. 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

TableJSON 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.4/5.0
Behavior5/5

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

Annotations only say readOnlyHint=false and openWorldHint=true. The description adds substantial behavior: idempotent replay semantics, on-chain verification rules, error codes (amount_mismatch, not_yet, conflict, unsupported_network, payee_changed), pending states, deleted listings, and the exact reply shape including review.can_rate/review.proof/review.counts. This is deep behavioral context beyond structured fields.

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

Conciseness2/5

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

The description is an extremely dense single-paragraph run-on that buries key facts (error codes, replay behavior, pending logic) in a wall of text. Front-loaded purpose is good, but the rest is hard to parse and violates conciseness; important details like rate-limit or retry guidance get lost.

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?

Given a mutation tool with no output schema, the description compensates fully: it explains verification logic, all likely error codes and their meanings, replay semantics, and the shape and meaning of the reply fields (review.can_rate, review.proof, review.counts, review.why). An agent has everything needed to call and interpret it.

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 description coverage is 100%, so each parameter already has a description. The prose adds nuance to tx_hash (the 'transaction' from x402 settlement) and listing_id omission rules, but largely duplicates what the schema already documents, including idempotency_key semantics. Baseline 3 is appropriate.

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?

Opens with a specific verb+resource+scope: '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.' It clearly distinguishes itself from siblings like deliver, review, and reviewPayment, which it explicitly routes to at the end.

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?

Explicitly states when to call: 'needs your API key; you must be the buyer or the seller', 'Both sides may call it: the first call records, a second call returns the same purchase with replayed: true', and when listing_id may be omitted. It also names alternatives: 'a buyer can instead review the payment with reviewPayment... which needs neither a key nor this call.'

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