Skip to main content
Glama

prepare_solana_swap

DestructiveIdempotent

Prepare an unsigned Jupiter-routed swap transaction on Solana using a durable nonce. Returns a preview for review; later complete signing with send_transaction.

Instructions

Build an unsigned Jupiter-routed swap DRAFT. Takes the quote object returned by get_solana_swap_quote and calls Jupiter's /swap-instructions endpoint to get the deconstructed instruction list, then composes the final v0 tx: [nonceAdvance, ...computeBudget, ...setup, swap, cleanup?, ...other]. DURABLE NONCE REQUIRED — if the wallet hasn't run prepare_solana_nonce_init, this errors pointing to it. Uses v0 VersionedTransaction with Address Lookup Tables (Jupiter routes commonly exceed legacy-tx account limits). Returns a compact preview + opaque handle; NOT yet signable — when the user says 'send', call preview_solana_send(handle) to pin the current nonce value, then send_transaction. BLIND-SIGN REQUIRED on Ledger (Jupiter's program ID isn't in the Solana app's clear-sign registry), so the user must match the Message Hash on-device — surfaced in the CHECKS block emitted by preview_solana_send.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
walletYesSolana wallet executing the swap. Must have an initialized durable-nonce account — run prepare_solana_nonce_init first if not set up yet.
quoteYesThe full `quote` object returned by get_solana_swap_quote. Pass it back verbatim — Jupiter computes a signature over the quote and rejects /swap-instructions if any field is mutated.
prioritizationFeeLamportsNoOptional priority fee in lamports. Omit to let Jupiter pick based on the local fee market (recommended).
Behavior5/5

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

Annotations already indicate destructive (mutation) and idempotent hints. The description adds extensive behavioral context: uses v0 VersionedTransaction with Address Lookup Tables, requires durable nonce, returns an opaque handle, and mentions blind-sign requirements on Ledger. It also notes error behavior if nonce uninitialized, without contradicting 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?

The description is concise yet comprehensive, starting with the core purpose, then prerequisites, technical details, and usage flow. Every sentence adds necessary information without redundancy, and the structure is front-loaded with the most critical information.

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 no output schema, the description fully explains return values (compact preview + opaque handle) and the required follow-up steps (preview_solana_send then send_transaction). It covers Ledger blind-sign requirements and CHECKS block references, making it complete for an AI agent to understand the tool's lifecycle.

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?

Input schema covers 100% of parameters with descriptions. The tool description reinforces the meaning of 'quote' (must be verbatim from get_solana_swap_quote) and prioritizationFeeLamports (optional, recommend omit). It adds value by explaining Jupiter's signature requirement, but baseline is already high due to schema coverage.

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 explicitly states 'Build an unsigned Jupiter-routed swap DRAFT' with a specific verb ('build') and resource ('unsigned swap draft'). It distinguishes itself from sibling tools like prepare_solana_lifi_swap (different router) and prepare_solana_native_send (different operation) by specifying Jupiter routing and the draft nature.

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?

The description clearly explains when to use: after obtaining a quote from get_solana_swap_quote. It also states prerequisites (durable nonce initialized via prepare_solana_nonce_init) and the subsequent steps (call preview_solana_send then send_transaction). It explicitly notes that the output is not yet signable, providing a complete usage flow.

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