Skip to main content
Glama

escrow_fund

Returns the Lightning invoice or Ark address a buyer needs to fund a Bitcoin escrow, then locks the paid funds. Also resumes a failed claim or switches rails before payment.

Instructions

Buyer: get the Lightning invoice that funds the escrow; after paying, call again with wait=true to lock the funds. Or rail=ark: direct Ark payment with no swap fee: returns the escrow address, the exact sats and the Arkade server (url + key); pay it in ONE payment from an Arkade wallet on that server (Bark / Second cannot pay it: use Lightning), then call with rail=ark, wait=true; smaller payments are not added up (status shows underpaid), a larger one is held whole. Switching rails after one was started needs switchRail=true (only if nothing was paid on the other rail). Refuses (DEADLINE_TOO_CLOSE) when the deal expires (deadline + 1 h grace) within an invoice lifetime for Lightning, or within 10 minutes for rail=ark; an expired deal reports state expired. Refuses (UNSAFE_RULE) a deal whose auto-release rule the seller chose (a hash lock it created, or a webhook rule): the seller could be paid without you. Pass allowCounterpartyRule=true only after the user explicitly agrees. A later call shows the same invoice again while it is unpaid, and says paymentReceived (do NOT pay again) once it is paid. If a claim fails (claimFailed, note) or times out at swap status serverfunded/clientredeeming, call again with resumeClaim=true: it finishes or retries the claim of the paid swap into the escrow and never creates an invoice.

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": {
      "id": "<id>"
    },
    "name": "escrow_fund"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYes
railNolightning (default, Satora swap) or ark (direct payment from an Arkade wallet on this escrow's Arkade server)
waitNo
switchRailNoconfirm switching from the other rail: nothing was paid there
resumeClaimNolightning only: finish/retry the Arkade claim of the already paid funding swap; no new invoice
allowCounterpartyRuleNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does so well: it names refusal codes (DEADLINE_TOO_CLOSE with the 1 h grace and 10-minute Ark window, UNSAFE_RULE), idempotency behavior (same invoice returned while unpaid, paymentReceived means do not pay again), partial-payment semantics (small underpayments are not summed, overpayments held whole), and claim-failure recovery. It stops short of stating custody/auth requirements or what a successful funding returns on the Lightning rail.

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?

The lead sentence is well front-loaded, but the body degenerates into long semicolon-chained clauses that mix rail selection, error codes, idempotency, and retry logic in one block. Almost every clause carries real information, yet the density and lack of structure make it harder to parse than it needs to be.

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

Completeness4/5

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

For a stateful funding tool with two rails, retries, and failure codes, the description covers the decision points and recovery paths an agent needs. The remaining gap is the return shape on the Lightning rail and unclear authorization requirements, but no output schema exists to cover them.

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 only 50%, but the description compensates: it explains wait (re-call to lock funds after paying), switchRail (precondition: nothing paid on the other rail), resumeClaim (finish/retry a paid swap claim, no new invoice), and allowCounterpartyRule (only with explicit user consent). Only id is left implicit.

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 description opens with a specific verb and resource from the caller's perspective ('Buyer: get the Lightning invoice that funds the escrow') and immediately distinguishes the two rails (Lightning swap vs direct Ark payment). An agent knows exactly what this tool produces and which mode it is entering.

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 when to use each rail, when to call again (wait=true, resumeClaim=true), the precondition for switchRail ('only if nothing was paid on the other rail'), and the consent gate for allowCounterpartyRule ('only after the user explicitly agrees'). Exclusions are explicit, including which wallets cannot pay the Ark rail.

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