Skip to main content
Glama
Yummybait-fin

uniswap-tx-builder

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
RPC_OPNoOptimism RPC URL for chain ID 10
RPC_ARBNoArbitrum RPC URL for chain ID 42161
RPC_ETHNoEthereum RPC URL for chain ID 1
RPC_BASENoBase RPC URL for chain ID 8453
RPC_POLYGONNoPolygon RPC URL for chain ID 137
MCP_HTTP_PORTNoPort to serve streamable HTTP transport instead of stdio

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
build_collectA

Build an UNSIGNED tx that collects all uncollected fees from a Uniswap v3 position to recipient. Returns tx={to,data,value,chainId} plus rlp (the unsigned EIP-1559 serialization for signing services). Set simulate=false to skip the eth_call dry-run (on by default).

build_closeA

Build an UNSIGNED tx that removes all liquidity and collects everything from a Uniswap v3 position (multicalls when needed). Returns the tx (+ unsigned rlp) plus the read position. Set burn=true to also burn the now-empty NFT in the same multicall. Set simulate=false to skip the eth_call dry-run (on by default).

build_mintA

Build an UNSIGNED tx that mints a new Uniswap v3 position. Amounts are decimal strings (wei) — compute them with get_pool_state (live ratio) right before minting, or stale prices revert the mint. Returns the tx plus unsigned rlp. Simulation is OFF by default here (minting needs token approvals and balances, so eth_call usually reverts); pass simulate=true to attempt it.

build_increaseA

Build an UNSIGNED tx that adds liquidity to an EXISTING Uniswap v3 position. Amounts are decimal strings (wei); mins are derived from slippageBps (default 0.5%). Returns the tx plus unsigned rlp. Simulation is OFF by default (needs token approvals + balances); pass simulate=true to attempt it.

plan_positionA

READ-ONLY helper (builds no tx). Given a human price range (token1 per token0) and optional human token amounts, reads each token's decimals over RPC and returns the aligned tickLower/tickUpper (for the fee's tick spacing) plus wei amount0Desired/amount1Desired — ready to feed into build_mint. token0 must be < token1 by address. Does NOT compute the optimal amount ratio for the range.

get_pool_stateA

READ-ONLY (builds no tx). Returns the pool's LIVE state: pool address, tick, sqrtPriceX96, price (token1 per token0, human units), tickSpacing. With rangePct: suggested tickLower/tickUpper within ±pct of spot, rounded INWARD to tick spacing. With balance0+balance1 (raw wei) + tickLower/tickUpper: amount0Desired/amount1Desired for build_mint computed from the live sqrtPrice ratio, plus which side limits. Errors if spot is outside the range. ALWAYS recompute amounts with this right before build_mint — stale ratios revert with 'Price slippage check'.

build_wrapB

Build an UNSIGNED payable tx that wraps amountWei native ETH into WETH via the Universal Router WRAP_ETH command (works under UR-allowlisting wallet policies where a direct WETH.deposit() doesn't). recipient defaults to the tx sender — omit it unless the WETH should go elsewhere. Returns the tx plus unsigned rlp. Pass sender (the signing wallet) to eth_call-simulate before signing.

build_swapA

Build an UNSIGNED tx that swaps amountInWei WETH for tokenOut (exact-in, single hop through the fee pool) via the Universal Router. With wrapWei (≥ amountInWei) the tx is payable and wraps that much native ETH first, swaps amountInWei of it, and sweeps the WETH remainder — use this when the wallet holds native ETH. Without wrapWei the wallet's WETH pays via Permit2 (needs a Permit2 approval). recipient defaults to the tx sender. Returns the tx plus unsigned rlp. Pass sender to eth_call-simulate before signing.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

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/Yummybait-fin/uniswap-tx-builder-mcp'

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