Skip to main content
Glama

build_swap_transaction

Build a Paraswap token swap on Ethereum, Arbitrum, or Base, returning an ordered list of raw transactions (approve + swap) ready for wallet review and execution.

Instructions

Build a token swap via Paraswap v5 on Ethereum (1), Arbitrum One (42161) or Base (8453). Returns an ORDERED list of raw transactions, each with to/data/value ready for wallet preview and execution: an exact-amount ERC-20 approve when the current allowance is short (preceded by a reset to zero when a partial allowance already exists — USDT-style tokens revert otherwise), then the swap. Execute them in order; do not reorder, skip or batch. Quotes are fetched fresh on every call and expire in minutes: build right before executing.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
amountYesAmount to sell in human units, e.g. "5" or "0.25"
chain_idYesChain to swap on: 1 (Ethereum), 42161 (Arbitrum One) or 8453 (Base)
src_tokenYesERC-20 address of the token to sell (0x...)
dest_tokenYesERC-20 address of the token to buy (0x...)
src_symbolNoOptional display label for the source token. Echoed back verbatim and NEVER verified against the contract — it is your own label, not evidence. The address is the identity; do not present this symbol to a human as a confirmed fact.
dest_symbolNoOptional display label for the destination token. Echoed back verbatim and NEVER verified against the contract — same rule as src_symbol: the address is the identity.
slippage_bpsNoMax slippage in basis points, default 250 (= 2.5%)
src_decimalsYesDecimals of the source token (e.g. USDC = 6)
user_addressYesWallet address that will sign the transactions (0x...)
dest_decimalsYesDecimals of the destination token (e.g. WETH = 18)
Behavior5/5

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

Despite having no annotations, the description reveals key behavioral details: it returns raw transactions, includes an approve step when allowance is short, and handles the USDT-style reset-to-zero case. It also discloses that quotes are fetched fresh and expire, which affects when the tool should be called.

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 moderately long but every sentence serves a purpose: scope, return format, approve nuance, execution order, and quote freshness. It is front-loaded with the primary action and structured logically, with no filler.

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 there is no output schema and no annotations, the description adequately explains the return value (list of transactions with to/data/value) and the required execution behavior. It also covers the quoting lifecycle. This is sufficient for an agent to correctly invoke the tool and interpret its result.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

All 10 parameters have thorough descriptions in the schema (100% coverage), including warnings about the src_symbol and dest_symbol not being verified. The description itself adds no extra parameter-specific details, so the baseline score of 3 is appropriate.

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 identifies the action ('Build a token swap'), the specific integration (Paraswap v5), supported chains, and the nature of the return value (an ordered list of raw transactions). This is more specific than a generic verb and distinguishes the tool from any potential alternative by naming the protocol and chains.

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?

It explicitly tells the agent to build right before executing because quotes expire in minutes, and provides a direct instruction on how to handle the returned transactions: execute them in order, do not reorder, skip or batch. While no alternative tools are listed, the guidance on timing and ordering is explicit and actionable.

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/rustok-org/paraswap-mcp'

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