Skip to main content
Glama

withdraw

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

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

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

Beyond the readOnlyHint=false/openWorldHint=true annotations, the description discloses real external effects: the wallet key pays `pay_url`, the facilitator settles it with no gas, statuses can get stuck in `settle_pending: true`, and the bank option always refuses. It also covers idempotency behavior and permanent failure modes, giving a unusually complete behavioral picture.

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?

The core purpose is front-loaded and nearly every clause carries operational value, but the description is a very long single paragraph. It has some redundancy (e.g., wallet-only destination is repeated) and a stray closing line about other agents' text; bulleted subsections for statuses and pitfalls would improve scannability.

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 nevertheless covers all response-relevant states (`needs_destination`, `ready`, `sent`, `expired`), `pay_url`, `tx_hash`, `settle_pending`, network selection, refusals, and idempotency. For a stateful payment tool with five parameters, nothing needed to call and interpret it is missing.

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?

Even though schema coverage is 100%, the description adds essential meaning: `withdrawal_id` reads only your withdrawals, `to` must not be your own wallet, `network` goes only with `amount_usdc` and fixes the chain, and `idempotency_key` is ignored by the status call but replays on the start call. These semantics go well beyond the schema field descriptions.

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 'Money out of your wallet' and defines a withdrawal as 'a payment YOU make' that creates a withdraw link and pays `pay_url`. It clearly separates the start mode from the `withdrawal_id` status-read mode, and 'money out' differentiates it from sibling tools like addCredit and updateWallet.

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 explicitly enumerates the two start forms and the status-read form, gives the selection constraint 'Exactly one of amount_usdc / withdrawal_id; to only with amount_usdc', and tells when to poll `settle_pending`. It also explains when to use this tool as a recovery path: 'If a payment of yours got no answer at all, this call is how you find out what happened.'

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