Skip to main content
Glama
Yummybait-fin

uniswap-tx-builder

Build a WETH→token swap transaction (Universal Router)

build_swap

Build an unsigned transaction to swap a specified amount of WETH for any ERC-20 token using Uniswap's Universal Router, with support for wrapping native ETH or using Permit2 approval.

Instructions

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
feeYes
senderNo
chainIdYes
wrapWeiNo
deadlineNo
simulateNo
tokenOutYes
recipientNo
amountInWeiYes
amountOutMinYes
Behavior4/5

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

No annotations provided, so description carries full burden. It discloses that the tx is unsigned, explains the swap mechanics (exact-in, single hop), wrap behavior, and simulation hint. Lacks details on gas implications or failure modes but is sufficiently transparent for common use.

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?

Description is a single dense paragraph that front-loads the main purpose. Every sentence adds value, but could benefit from structuring (e.g., separate sections for parameters, return value). Efficient for its information density.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 10 parameters, no annotations, no output schema, the description provides a good overview of functionality and key parameters. It explains the core flow but lacks details on return format and some parameters. Still adequate for an experienced agent.

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?

Schema description coverage is 0%, so description must compensate. It explains key parameters (amountInWei, tokenOut, fee, wrapWei, recipient, sender) and their roles. Missing explicit details for chainId, deadline, simulate, and amountOutMin, but the given context adds significant value.

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 specifies the tool builds an unsigned transaction for a WETH→token exact-in single-hop swap via Universal Router. It identifies the key resources (WETH, tokenOut, fee pool) and distinguishes from sibling tools by focusing on this specific swap operation.

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 clear guidance on when to use wrapWei vs not (native ETH vs WETH via Permit2) and mentions recipient defaults to sender. However, it does not explicitly compare against sibling tools or state when to choose this tool over alternatives like build_close or build_mint.

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

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