Skip to main content
Glama

prepare_btc_send

DestructiveIdempotent

Prepares an unsigned Bitcoin PSBT for native send. Selects coins, sets fee rate or priority, enables RBF by default, and returns a 15-minute handle for Ledger clear-signing of every output.

Instructions

Build an unsigned Bitcoin native-send PSBT (segwit/taproot only in Phase 1). Returns a 15-min handle the agent forwards to send_transaction; the Ledger BTC app clear-signs every output (address + amount) + fee on-screen, so there is NO blind-sign hash to pre-match in chat. The verification block surfaces every output's address, amount in BTC, isChange flag, fee (BTC + sat/vB), and RBF flag. Fee selection: pass feeRateSatPerVb for an explicit sat/vB number, OR feePriority for a fuzzy preset (fastestFee / halfHourFee / hourFee / economyFee / minimumFee — issue #435) that resolves to mempool.space's named buckets at prepare time. Default (neither set) is halfHourFee. The resolved sat/vB always appears in the response under feeRateSatPerVb so the user sees what was picked. Coin-selection runs branch-and-bound + accumulative fallback via the coinselect library; a fee-cap guard refuses any tx whose fee exceeds max(10 × feeRate × vbytes, 2% of total output value) unless allowHighFee: true is passed. RBF is enabled by default (sequence 0xFFFFFFFD); pass rbf: false to mark final.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
walletYesOne paired Bitcoin source address (string), OR an array of 1-20 paired source addresses for multi-input consolidation (issue #264). All addresses must belong to the SAME Ledger account (same accountIndex + addressType) — Phase 1 mixed-type sends (segwit + taproot in one tx) are out of scope. UTXOs are fetched in parallel for every listed source and merged into one coin-selection pool. "max" sweeps every UTXO from every listed wallet into a single output. Phase 1 sends only support native segwit (`bc1q...`) and taproot (`bc1p...`) sources; legacy (`1...`) and P2SH-wrapped (`3...`) sends are deferred.
toYesBitcoin recipient address. Any of the four mainnet types is accepted as a destination — the restriction is only on the source side.
amountYesDecimal BTC string (up to 8 fractional digits, e.g. "0.001") or "max" to sweep the full balance minus fees. "max" picks the fee-aware amount after coin-selection so the user doesn't have to subtract fees by hand.
feeRateSatPerVbNoFee rate in sat/vB. Optional — when omitted, uses mempool.space's `halfHourFee` recommendation (~3-block confirm target). Override for priority sends through congestion. Capped at 10000 sat/vB for safety. Mutually exclusive with `feePriority`.
feePriorityNoIssue #435 — fuzzy-fee preset that resolves to mempool.space's named buckets (`fastestFee` ~next-block, `halfHourFee` ~3-block, `hourFee` ~6-block, `economyFee` lowest still-included, `minimumFee` floor). Resolves at prepare time via `getFeeEstimates()`; the resolved sat/vB appears in the response so the user sees what was picked. Default (neither preset nor `feeRateSatPerVb` supplied) is `halfHourFee`. Mutually exclusive with `feeRateSatPerVb`.
rbfNoBIP-125 Replace-By-Fee. Default true → sequence 0xFFFFFFFD on every input, marking the tx replaceable so the user can fee-bump if it stalls. Set false → 0xFFFFFFFE (final, not replaceable). RBF is the default for every modern wallet.
allowHighFeeNoOverride the fee-cap guard. The cap is `max(10 × feeRate × vbytes, 2% of total output value)`. Legitimate priority sends through heavy congestion can exceed it; pass true after confirming with the user.
Behavior5/5

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

Annotations indicate destructive and idempotent behavior, and the description extensively details behaviors: building unsigned PSBT, 15-min handle, Ledger clear-signing, no blind-sign, verification block outputs, fee selection mechanics, coin-selection algorithm, fee-cap guard, RBF default, and override conditions. No contradictions with annotations.

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 description is thorough but fairly long; however, every sentence adds essential information. It is front-loaded with the core purpose and structured to cover key aspects sequentially. A slight reduction in verbosity could improve conciseness without losing clarity.

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 the tool's complexity (7 parameters, no output schema), the description covers all critical aspects: return value (handle), behavior (clear-signing, coin-selection, fee logic), edge cases (fee cap override, RBF toggle), and constraints (Phase 1 scope, source address types). It is fully self-contained and leaves no major gaps.

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 100%, but the description adds significant value beyond the schema: wallet explains consolidation and source type restrictions; to explains recipient acceptance; amount explains 'max' and decimal format; feeRateSatPerVb explains default and cap; feePriority explains preset resolution; rbf explains sequence numbers; allowHighFee explains cap override condition. Each parameter's intent and behavior are clarified.

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 clearly states the verb 'Build' and resource 'unsigned Bitcoin native-send PSBT', specifies the scope (segwit/taproot only in Phase 1), and distinguishes from sibling tools like prepare_btc_multisig_send or prepare_btc_lifi_swap.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides context on when to use (native segwit/taproot sources, explicit or preset fee selection) and mentions deferred capabilities (legacy/P2SH, mixed types) but does not explicitly compare with sibling tools like prepare_btc_rbf_bump or prepare_btc_multisig_send. It gives good guidance on parameter usage and defaults.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/szhygulin/vaultpilot-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server