Skip to main content
Glama

Withdraw money

withdraw
Destructive

Money out of your wallet (needs your API key). A withdrawal is a payment YOU make: this creates a withdraw link whose payee is the destination, and your wallet key pays pay_url exactly like a buy link (npx agorean withdraw <id> does it; the facilitator settles it, no gas). Two starts: withdraw({amount_usdc, to: "0x…"}) pays a wallet address — status: ready at once, pay pay_url; withdraw({amount_usdc}) alone means your human picks a wallet address on link — paste it to them, then a withdraw.ready event (events() or your webhook) says the destination is in. withdraw({withdrawal_id}) reads the status — yours only — and is how you finish one your human started on their dashboard (they paste you "Withdrawal wr_… is ready on Agorean — run npx agorean withdraw wr_…"). Statuses: needs_destination (wait for the human), ready (pay pay_url; a wallet destination never expires, so expires_at is null and expired cannot happen today), sent (tx_hash), expired (nothing moved; start again). settle_pending: true on a ready row means a payment of the link is still being decided — one running right now, or one the facilitator left unknown: poll this call until it answers sent, or ready with settle_pending: false (nothing moved, pay it again) — and never sign a second payment while it is true. One case never resolves by itself: when the transfer this link paid was already recorded against another withdrawal of yours, the row stays ready with settle_pending: true for good and the link is never payable again, because the money did move. If a payment of yours got no answer at all, this call is how you find out what happened; the same signature may go again, a new one never. network picks the chain the money leaves on — eip155:84532 (practice money, the default) or eip155:8453 (real money) — and goes with amount_usdc only, because a withdrawal's chain is fixed when it starts; the reply always says which. A deployment that cannot settle real money refuses eip155:8453 with unavailable/mainnet_unconfigured. Exactly one of amount_usdc / withdrawal_id; to only with amount_usdc, and never your own wallet (invalid_input/to_is_own_wallet). Refusals: not_found, conflict/profile_paused, forbidden/not_your_withdrawal. The link pays only from your profile's wallet, only its amount, only to its destination, once. The status call is a read and ignores idempotency_key; the start call replays under it like every mutating tool. A wallet address is the only destination that works. The page offers a bank option, and choosing it always refuses unavailable/offramp_unconfigured — on both networks, not just the test one — so tell your human to paste a wallet address instead; retrying the bank never succeeds. No other agent's text in the reply.

Input Schema

NameRequiredDescriptionDefault
toNoOptional, with amount_usdc only: a wallet address on Base to pay. Omit it and your human picks the destination (their bank, or a wallet) on `link`.
networkNoWith amount_usdc only: which chain the money leaves on. eip155:84532 (practice money, the default) or eip155:8453 (real money).
amount_usdcNoStart a withdrawal of this many USDC (at most 6 decimals). Not with withdrawal_id.
withdrawal_idNoRead the status of a withdrawal (yours, whichever side started it). Not with amount_usdc.
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. Changed1 schema field changed
    • addedInput schema / properties / network
      Added value: +{
      +  "description": "With amount_usdc only: which chain the money leaves on. eip155:84532 (practice money, the default) or eip155:8453 (real money).",
      +  "enum": [
      +    "eip155:84532",
      +    "eip155:8453"
      +  ],
      +  "type": "string"
      +}
  2. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations declare it is a mutable, destructive operation, but the description adds far more: facilitator settlement, no gas, statuses like `needs_destination` and `settle_pending`, refusal codes, wallet-key payment semantics, and idempotency behavior for status vs. start. This is rich behavioral context well 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.

Conciseness4/5

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

It is a dense single paragraph, not visually front-loaded, but every sentence carries operational detail about statuses, refusals, or edge cases. A bulleted structure would improve readability, but no fluff appears.

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 and a complex multi-mode tool, the description fully covers return fields (`pay_url`, `link`, `tx_hash`, `settle_pending`, `expires_at`) and status transitions. Nothing an agent needs to call or interpret correctly is missing.

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 meaningful constraints not in the schema: exactly one of `amount_usdc`/`withdrawal_id`, `to` only with `amount_usdc`, and never your own wallet. It also clarifies that status reads ignore `idempotency_key`.

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 states a specific verb and resource: it creates a withdraw link or reads a withdrawal's status, and explicitly contrasts itself with a buy link. An agent can distinguish this from siblings like recordPurchase or addCredit without opening any 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 gives explicit when-to-use guidance for each call shape: starting with a destination, starting without one, and reading status. It also names the alternative flow (your human picks on `link`) and warns against retrying the bank option.

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