Skip to main content
Glama

Stabledrop escrow payments

Prepare Escrow Payment

prepare_escrow_payment
Idempotent

Work out where a payment must go, before anybody signs or sends anything.

seller and nominal_buyer may each be a wallet address OR AN EMAIL ADDRESS — an email is converted to the wallet that person owns, so you never need to know a wallet to use this.

The parties are checked against the sanctions lists before an address is given. If any of them is listed the answer is error: sanctioned_party with no address, and the payment cannot be made through this service. The same answer comes back for terms whose payment contract was already refused on sanctions grounds when its money arrived: its address is not handed out again. If the check cannot be done right now the answer is error: service_unavailable with retryable: true and no address; try again shortly.

Returns the payment address these terms produce, and TWO ways to fund it. Both end at the same address holding the same money; they differ only in who sends the transaction.

Transfer it yourself. Send the tokens to the address from any wallet — a browser wallet, a hardware wallet, an exchange withdrawal. Nothing to sign for us, and no payer needed, because the payment contract never asks who paid: it reads its own balance. Then call settle_escrow_payment with no signature and we create the payment contract around what is there.

Or let us relay it. Pass payer and this returns an EIP-3009 authorization for them to sign. We broadcast it and pay the gas, so the payer needs no gas at all. This is the only one an agent can complete unattended, and the only one that needs a key anywhere.

Either way the address is the same, because it is a pure function of the terms. That is also what makes the relayed form safe: the payer signs to as part of the authorization, committing to every term at once — alter any of them afterwards and the address moves and the signature stops matching.

amount is in the TOKEN's base units (1 USDC = 1000000), because that exact figure is one of the terms the address derives from.

expiry_timestamp is an absolute Unix time — when the dispute window closes. 0 settles instantly with no recourse. There is no default: "instant, deliberately" and "nobody said" are different, and a caller must not discover afterwards which one they got.

nominal_buyer is who may dispute and receives a refund. For an agentic payment this should be the PERSON, not the agent — they are the one who will later read a report and decide whether to object.

seller and nominal_buyer may each be a wallet address OR an email address. An email resolves to the wallet Privy holds for that person — made for them if they have never logged in — and the same email always resolves to the same wallet, so the address derived here is the one settle_escrow_payment derives too. The resolved wallets come back under parties. A seller given by email is paid into that wallet; they sign in with the email to reach it.

external_id keeps two otherwise-identical payments apart, and is one of the terms the address derives from. Leave it out and a unique one is generated. That is the right default: two payments matching in seller, amount, maturity and buyer would otherwise derive to the SAME address, and funding the second sends money into the first payment contract — recoverable only after that one is claimed, and only to ITS buyer.

⚠️ PASS BACK THE external_id THIS RETURNS, not the one you sent. A generated one is only knowable from the result, and settle derives the address again from whatever it is given: a different id is a different address, and the money is at this one.

Supply your own for the opposite behaviour — a checkout hash gives "one checkout, one payment contract", so re-presenting the same purchase returns the same address rather than a second.

description is what the payment is FOR, in the buyer's own words — ask them for it rather than defaulting. It is what they will be looking at in the dashboard weeks later deciding whether to dispute, and "Protected payment" tells them nothing about which one this was. It does not affect the address, so it can be set freely here.

brand is the white-label partner the payment is being made under, if any (the ?b= id, e.g. escrow-me). It is recorded on the contract for attribution only: it does not affect the address, and a malformed one is ignored rather than refused.

product_name is what is being bought, shown on both parties' dashboards. Display only, like brand. A seller or nominal buyer given by email is recorded with that email as well, so the payment contract shows to them the way a request made on the site does.

⚠️ 1 to 160 characters. Longer is refused HERE rather than at the chain, where the check happens after the money has already moved.

arbiter is who decides a dispute. Leave it out for the default arbiter, which is almost always right. It is one of the terms the address derives from, so pass the same value to settle_escrow_payment.

Input Schema

NameRequiredDescriptionDefault
brandNoThe white-label partner the payment is made under, if any: the site's `?b=` id, e.g. escrow-me. Attribution only; does not affect the address.
payerNoWallet address (0x…) that will sign an EIP-3009 authorization for us to relay, gas-free. Omit when the payer transfers the tokens to the address themselves.
amountYesHow much, in the token's base units: 1 USDC = 1000000, so 25 USDC is 25000000. One of the terms the payment address derives from.
sellerYesWho gets paid: a wallet address (0x…) OR an email address. An email is converted to the wallet that person owns, created for them if they have never signed in; the same email always gives the same wallet.
arbiterNoWallet address (0x…) of who decides a dispute. Omit for the default arbiter. One of the terms the address derives from, so pass the same value to both tools.
descriptionNoWhat the payment is for, in the buyer's own words, 1 to 160 characters, e.g. 'Logo design, final files'. Shown on the dashboard; does not affect the address.Protected payment
external_idNoYour own id for this payment, e.g. a checkout hash, so re-presenting the same purchase derives the same address. Omit and a unique one is generated; pass back the value this returns.
product_nameNoWhat is being bought, e.g. 'Blue ceramic vase'. Shown on both parties' dashboards; display only.
token_symbolNoThe token to pay in, e.g. USDC. Must be one the service supports.USDC
nominal_buyerYesWho may dispute and receives any refund — the PERSON, not the agent: a wallet address (0x…) OR an email address. An email is converted to that person's wallet, created for them if they have never signed in.
expiry_timestampYesWhen the dispute window closes, as an absolute Unix time in seconds, e.g. 1764547200. 0 settles instantly with no recourse. There is no default.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changed
    • addedInput schema / properties / amount / description
      Added value: +"How much, in the token's base units: 1 USDC = 1000000, so 25 USDC is 25000000. One of the terms the payment address derives from."
    • addedInput schema / properties / arbiter / description
      Added value: +"Wallet address (0x…) of who decides a dispute. Omit for the default arbiter. One of the terms the address derives from, so pass the same value to both tools."
    • addedInput schema / properties / brand / description
      Added value: +"The white-label partner the payment is made under, if any: the site's `?b=` id, e.g. escrow-me. Attribution only; does not affect the address."
    • addedInput schema / properties / description / description
      Added value: +"What the payment is for, in the buyer's own words, 1 to 160 characters, e.g. 'Logo design, final files'. Shown on the dashboard; does not affect the address."
    • addedInput schema / properties / expiry_timestamp / description
      Added value: +"When the dispute window closes, as an absolute Unix time in seconds, e.g. 1764547200. 0 settles instantly with no recourse. There is no default."
    • addedInput schema / properties / external_id / description
      Added value: +"Your own id for this payment, e.g. a checkout hash, so re-presenting the same purchase derives the same address. Omit and a unique one is generated; pass back the value this returns."
    • addedInput schema / properties / payer / description
      Added value: +"Wallet address (0x…) that will sign an EIP-3009 authorization for us to relay, gas-free. Omit when the payer transfers the tokens to the address themselves."
    • addedInput schema / properties / product_name / description
      Added value: +"What is being bought, e.g. 'Blue ceramic vase'. Shown on both parties' dashboards; display only."
    • addedInput schema / properties / token_symbol / description
      Added value: +"The token to pay in, e.g. USDC. Must be one the service supports."
  2. Changed1 schema field changed
    • changedInput schema / properties / description / default
      Previous value: -"Escrow payment"New value: +"Protected payment"
  3. Changed1 schema field changed
    • addedInput schema / properties / arbiter
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null
      +}
  4. Changed2 schema fields changed
    • addedInput schema / properties / brand
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null
      +}
    • addedInput schema / properties / product_name
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null
      +}
  5. Changed2 schema fields changed
    • addedInput schema / properties / nominal_buyer / description
      Added value: +"Who may dispute and receives any refund — the PERSON, not the agent: a wallet address (0x…) OR an email address. An email is converted to that person's wallet, created for them if they have never signed in."
    • addedInput schema / properties / seller / description
      Added value: +"Who gets paid: a wallet address (0x…) OR an email address. An email is converted to the wallet that person owns, created for them if they have never signed in; the same email always gives the same wallet."
  6. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Far beyond the annotations (`readOnlyHint: false`, `destructiveHint: false`, `openWorldHint: true`), it discloses the sanctions pre-check and its two failure shapes (`error: sanctioned_party` with no address, `error: service_unavailable` with `retryable: true`), that a previously refused contract never re-issues an address, and that the relayed path is the only one that needs a key or can be completed unattended. The warning to pass back the returned `external_id` rather than the one sent is exactly the kind of hidden precondition annotations cannot carry; the only mild tension with `idempotentHint: true` is that the generated default id makes repeat calls derive different addresses, but the description spells that mechanism out rather than hiding it.

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?

Well front-loaded, with concrete warnings and the funding-choice tradeoff placed before the per-field notes. It loses a point for redundancy: the wallet-or-email resolution rule is stated three times in near-identical wording (opening, bolded middle paragraph, and again via the schema), and the `external_id` collision risk is explained at greater length than the decision requires.

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?

For an 11-parameter, stateful tool with real financial consequences, it covers everything an agent needs: the address-derivation model, both funding routes, error outcomes, the returned-`external_id` handoff, and the next tool to call. Return values are not re-explained, which is correct given an output schema exists.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is already 100%, yet the description still adds meaning the schema cannot: `amount` is in token base units because the figure is itself an address term, `expiry_timestamp` of `0` means instant settlement with no recourse and has no default, and `nominal_buyer` must be the person rather than the agent. It also adds cross-call semantics — `arbiter` and `external_id` must match what `settle_escrow_payment` receives — and the 160-character refusal boundary on `description`.

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 names the specific job — deriving where a payment must go before anything is signed or sent — and the body pins down the concrete output: a deterministic payment address plus two funding routes. It explicitly separates itself from `settle_escrow_payment` ("Then call `settle_escrow_payment` with no signature and we create the payment contract around what is there"), so an agent can place it in the sibling set without opening a 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 lays out the two mutually exclusive funding paths and the exact condition that selects each: omit `payer` to transfer directly, or pass `payer` to get an EIP-3009 authorization you relay gas-free. It also states when to supply your own `external_id` versus letting one be generated, and names `settle_escrow_payment` as the necessary follow-up — explicit alternatives, not inferred ones.

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