Skip to main content
Glama

prepare_swap

Prepare unsigned cryptocurrency swap or bridge transactions using LiFi aggregator. Routes same-chain swaps through optimal DEX paths and cross-chain swaps via bridge+DEX combinations for execution.

Instructions

Prepare an unsigned swap or bridge transaction via LiFi aggregator. Same-chain swaps use the best DEX route; cross-chain swaps use a bridge + DEX combo. The returned tx can be sent via send_transaction.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
walletYes
fromChainYes
toChainYes
fromTokenYes
toTokenYes
amountYesHuman-readable decimal amount of fromToken, NOT raw wei/base units. Example: "1.5" for 1.5 USDC, "0.01" for 0.01 ETH. The tool resolves decimals on-chain and converts internally.
fromTokenDecimalsNoOptional decimals hint for fromToken if on-chain lookup fails (rare). Native is 18.
slippageBpsNoSlippage tolerance in basis points (50 = 0.5%, 100 = 1%). Default ~50. Hard-capped at 500 (5%) — anything higher is almost always a sandwich-bait misconfiguration. If a legitimate thin-liquidity route genuinely needs >1%, also pass `acknowledgeHighSlippage: true`.
acknowledgeHighSlippageNoOpt-in flag required when slippageBps > 100 (1%). Forces the caller to state that an unusually-high slippage is intentional — the default rejects the tx to protect the user from MEV sandwich attacks.
Behavior4/5

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

With no annotations provided, the description carries full burden and does well: it discloses that the tool prepares unsigned transactions (implying no execution), uses LiFi aggregator for routing, handles both same-chain and cross-chain scenarios, and returns a transaction for sending. It doesn't mention rate limits, auth needs, or error conditions, but covers core behavior adequately.

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 perfectly front-loaded and concise: three sentences with zero waste. The first sentence states the core purpose, the second explains routing logic, and the third specifies the output usage. Every sentence earns its place.

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 9 parameters, 44% schema coverage, no annotations, and no output schema, the description does well but has minor gaps. It explains the tool's routing behavior and output usage clearly, but doesn't cover all parameter meanings or potential error cases. For a transaction preparation tool with complex parameters, it's mostly complete but could mention more about the returned transaction structure.

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 only 44%, but the description compensates by explaining key parameter semantics: it clarifies that same-chain swaps use DEX routes while cross-chain use bridge+DEX combos, and mentions the tool resolves decimals internally. However, it doesn't explain all 9 parameters (e.g., wallet format, chain enums), leaving some gaps.

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 states the tool's purpose with specific verbs ('prepare an unsigned swap or bridge transaction') and resources ('via LiFi aggregator'), distinguishing it from siblings like 'get_swap_quote' (which only quotes) and 'send_transaction' (which executes). It explicitly mentions both same-chain and cross-chain operations.

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 provides explicit guidance on when to use this tool: for preparing unsigned transactions that can be sent via 'send_transaction'. It distinguishes from 'get_swap_quote' by emphasizing transaction preparation rather than just quoting, and specifies the intended next step.

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/vaultpilot-mcp'

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