Skip to main content
Glama

prepare_uniswap_swap

DestructiveIdempotent

Prepare a direct Uniswap V3 swap transaction with automatic fee tier selection. Supports exact-in and exact-out, native token swaps, and returns an unsigned tx for signing.

Instructions

Prepare a direct Uniswap V3 swap (bypasses LiFi aggregator). Use this ONLY when the user explicitly asks for Uniswap — otherwise default to prepare_swap which compares routes across venues. Same-chain only (Uniswap V3 is not a bridge). Auto-picks the best pool fee tier (100/500/3000/10000 bps) by quoting all four against QuoterV2 and choosing the one with the best price; pass feeTier to override. Supports ERC-20 <-> ERC-20, native-in (ETH -> ERC-20), and native-out (ERC-20 -> ETH). Both exact-in and exact-out. Returns an unsigned tx (with a reset+approve chain when the router needs allowance) that send_transaction can forward to Ledger Live. Single-hop only in v1 — multi-hop routes through an intermediate asset (e.g. via WETH) fall back to prepare_swap.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
walletYes
chainYes
fromTokenYes
toTokenYes
amountYesHuman-readable decimal amount, NOT raw wei/base units. Example: "1.5" for 1.5 USDC, "0.01" for 0.01 ETH. Interpreted as fromToken input by default; set `amountSide: "to"` for exact-out. The tool resolves decimals on-chain.
amountSideNoWhich side of the swap `amount` refers to. "from" (default) = exact-in: spend exactly `amount` of fromToken, receive a variable output. "to" = exact-out: receive exactly `amount` of toToken, input sized to hit the target.
fromTokenDecimalsNoOptional decimals hint for fromToken if on-chain lookup fails. Native is 18.
toTokenDecimalsNoOptional decimals hint for toToken if on-chain lookup fails. Native is 18.
slippageBpsNoSlippage tolerance in basis points (50 = 0.5%). Default 50. Hard-capped at 500 (5%); > 100 requires `acknowledgeHighSlippage: true` to prevent MEV sandwiching.
acknowledgeHighSlippageNoOpt-in flag required when slippageBps > 100. Forces explicit acknowledgement of unusually-high slippage.
feeTierNoOptional fee-tier override (100 / 500 / 3000 / 10000 bps). When omitted, QuoterV2 is queried across all four tiers and the best-pricing pool is picked.
Behavior5/5

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

Goes beyond annotations by describing auto-picking fee tier via QuoterV2, returning an unsigned tx with optional reset+approve chain, and detailing support for native tokens and exact-in/exact-out. 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?

Single paragraph, front-loaded with purpose and usage guidance. Every sentence adds value without repetition. Length is appropriate for 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?

Covers swap types, fee selection, slippage, approval handling, and fallback behavior. No output schema, but describes return as unsigned tx for send_transaction. Complete given tool complexity.

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?

Adds meaning to parameters like `amount` (human-readable), `feeTier` (optional override), `slippageBps` (default 50, cap 500), and `acknowledgeHighSlippage`. Schema coverage is 64%, but description compensates well for missing schema descriptions on other params.

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?

Description clearly states 'Prepare a direct Uniswap V3 swap (bypasses LiFi aggregator)', specifying the exact protocol and distinguishing it from the sibling `prepare_swap`. It also details supported swap types (same-chain, native in/out, exact-in/exact-out).

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?

Explicitly instructs to use only when user asks for Uniswap, otherwise default to `prepare_swap`. Also notes that multi-hop routes fall back to `prepare_swap`. Provides clear when-to-use and when-not-to-use 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