Skip to main content
Glama

prepare_btc_send

DestructiveIdempotent

Prepare an unsigned Bitcoin PSBT for sending from a Ledger wallet. Supports segwit/taproot inputs, fee rate or priority presets, RBF, and coin selection with fee cap.

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?

Discloses behavioral traits beyond annotations, including 15-min handle, verification block, coin-selection method, fee-cap guard, and RBF default. No contradiction 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.

Conciseness5/5

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

Efficiently structured with no wasted words. Each sentence serves a purpose, starting with core function and expanding on details.

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?

Thoroughly covers inputs, behavior, and return values despite no output schema. All necessary information for an agent to use the tool is present.

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?

Adds significant value beyond schema descriptions, explaining multi-input consolidation, 'max' behavior, fee defaults, mutual exclusivity, and cap formula. Schema coverage is 100%.

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 tool builds an unsigned Bitcoin native-send PSBT for segwit/taproot only, with a specific verb and resource. It distinguishes from siblings like prepare_btc_multisig_send and 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?

Provides detailed guidance on fee selection, RBF, and high-fee overrides. Does not explicitly compare to siblings but covers many usage scenarios and constraints.

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/recon-crypto-mcp'

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