Skip to main content
Glama

prepare_btc_lifi_swap

DestructiveIdempotent

Build a PSBT to bridge native BTC to tokens on EVM chains or Solana via LiFi, with clear-signed outputs for Ledger hardware wallets.

Instructions

Build an unsigned Bitcoin PSBT-v0 that bridges native BTC to a token on another chain via LiFi's aggregator. LiFi auctions the route across intent solvers (NEAR Intents, Garden, Thorswap, Chainflip, Symbiosis, …) and returns a PSBT depositing to the chosen solver's vault address with an OP_RETURN memo committing to the cross-chain destination. Destinations: every EVM chain (ethereum/arbitrum/polygon/base/optimism) and Solana — TRON has no LiFi route from BTC and is rejected. Source-side scope (Phase 1, mirrors prepare_btc_send): native segwit and taproot only. Returns a 15-min handle the agent forwards to send_transaction; the Ledger BTC app clear-signs every output (vault deposit + OP_RETURN + change-back-to-source + LiFi fee output) on-screen, so there is NO blind-sign hash to pre-match in chat. The verification block surfaces the vault address, OP_RETURN bytes (hex + ASCII prefix), expected and minimum output on the destination, slippage, the chosen solver, and execution duration estimate. Server-side checks before forwarding: every PSBT input belongs to the source address, exactly one OP_RETURN output is present, the deposit output address matches the LiFi-advertised vault, and nonWitnessUtxo is hydrated on every input (Ledger 2.x rejects segwit/taproot inputs without it).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
walletYesPaired Bitcoin source address. Phase 1 source-side scope: native segwit (`bc1q…`) and taproot (`bc1p…`) only. Multi-source consolidation is out of scope here — LiFi runs its own UTXO scan against `fromAddress` and bakes the input set into the PSBT.
toChainYesDestination chain. EVM `SupportedChain` (ethereum/arbitrum/polygon/base/optimism) for an EVM bridge, or `"solana"` for native SOL/SPL delivery. TRON is NOT routable from BTC via LiFi (rejected with a clear error).
toTokenYesDestination token. EVM hex when `toChain` is EVM; SPL mint (base58) when `toChain === "solana"`. `"native"` resolves to the chain's conventional native sentinel (`0x0…0` for EVM, wrapped-SOL mint for Solana).
toAddressYesDestination wallet — REQUIRED. The Bitcoin source address is not a valid recipient on any destination chain. Format must match the destination (Solana base58 for `"solana"`, EVM hex otherwise).
amountYesDecimal BTC string (up to 8 fractional digits, e.g. "0.005"). "max" is NOT supported — bridges commit to an exact deposit amount via the OP_RETURN memo at quote time, so the amount must be known up-front.
slippageBpsNoSlippage tolerance in basis points (50 = 0.5%, 100 = 1%). Default ~50. Hard-capped at 500 (5%); above 100 (1%) requires `acknowledgeHighSlippage: true` to opt in. Cross-chain bridges may impose their own minimums above this.
acknowledgeHighSlippageNoRequired when `slippageBps > 100`. Mirrors the `prepare_swap` guard — forces the caller to state that an unusually-high slippage is intentional.
Behavior5/5

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

The description provides extensive behavioral details beyond annotations: source-side scope (segwit/taproot only), that LiFi auctions routes, the PSBT contains specific outputs (vault deposit, OP_RETURN, change, fee), Ledger app clearsigns (no blind sign), verification block contents, and server-side checks. This fully informs the agent of the tool's behavior and constraints.

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 well-structured with paragraphs covering purpose, process, and verification. It is front-loaded with the most essential information. While lengthy, every sentence adds value. Minor improvement could be tightening some phrasing, but overall it is concise given the complexity.

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?

Despite no output schema, the description fully explains the return value (PSBT with 15-min handle) and the verification block details. It covers all necessary aspects: dependencies (LiFi, Ledger), constraints (source address type, destination chains), and failure conditions (TRON rejection). The agent has enough information to use the tool correctly.

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?

The input schema has 100% description coverage, with each parameter clearly documented. The tool description adds overarching context such as 'multi-source consolidation is out of scope' and explains why 'max' is not supported for amount. While per-parameter details are already in schema, the description enhances understanding of how parameters interact in the broader workflow.

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 the resource 'unsigned Bitcoin PSBT-v0' with the specific purpose of bridging native BTC to a token on another chain via LiFi's aggregator. It distinguishes itself from sibling tools like prepare_btc_send by emphasizing the cross-chain bridge aspect and explicitly listing supported destinations while rejecting TRON.

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 explains the tool returns a 15-min handle that should be forwarded to send_transaction, indicating the workflow. It also specifies which chains are supported and that TRON is rejected. However, it does not explicitly mention when not to use this tool versus alternatives like prepare_btc_send for simple sends, which would improve guidance.

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