Skip to main content
Glama

dex_tx_swap_prepare

Destructive

Stage a swap session (server-side build only); returns swap_session_id. Does not sign or submit. Call after quote confirmed by user.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
amountYesHuman-readable amount (e.g. '0.01')
slippageYesSlippage as decimal (0.01=1%, 0.1=10%)
token_inYesSource token address. Use '-' for native coin
mcp_tokenNoMCP session token obtained from login (dex_auth_google_login_poll or dex_auth_gate_login_poll). MUST be provided in every call to this tool after login; omitting it will result in 403
native_inYes⚠️ CRITICAL — Must be set correctly, wrong value causes transaction failure or fund loss. Simply check: is token_in a native/gas coin? If yes, set 1; if it's a contract token, set 0. Native coins: ETH, BNB, MATIC, AVAX, SOL — these are the chain's gas coins, native_in=1. Contract tokens: USDT, USDC, WETH, WBNB, DAI, etc. — these are ERC20/BEP20/SPL tokens, native_in=0. NOTE: BNB = native coin (native=1), WBNB = wrapped contract token (native=0). User saying 'BNB' means the native coin unless they explicitly say 'WBNB'. Same for ETH vs WETH, SOL vs WSOL. When native_in=1, token_in is auto-normalized to '-'.
to_walletNoDestination chain receiving address. ONLY required for CROSS-CHAIN swaps where chain_id_in and chain_id_out belong to different address groups (e.g. EVM→Solana). Obtain from dex_wallet_get_addresses. Omit for single-chain swaps — defaults to user_wallet.
token_outYesDestination token address
account_idYesUser account ID (UUID)
native_outYes⚠️ CRITICAL — Must be set correctly, wrong value causes transaction failure or fund loss. Simply check: is token_out a native/gas coin? If yes, set 1; if it's a contract token, set 0. Native coins: ETH, BNB, MATIC, AVAX, SOL — these are the chain's gas coins, native_out=1. Contract tokens: USDT, USDC, WETH, WBNB, DAI, etc. — these are ERC20/BEP20/SPL tokens, native_out=0. NOTE: BNB = native coin (native=1), WBNB = wrapped contract token (native=0). User saying 'BNB' means the native coin unless they explicitly say 'WBNB'. Same for ETH vs WETH, SOL vs WSOL. When native_out=1, token_out is auto-normalized to '-'. CROSS-CHAIN EXAMPLE: USDT(BSC) → SOL(Solana): native_in=0 (USDT is contract token), native_out=1 (SOL is native coin). CROSS-CHAIN EXAMPLE: ETH(Ethereum) → USDT(BSC): native_in=1 (ETH is native coin), native_out=0 (USDT is contract token).
chain_id_inYesSource chain ID (e.g. 1=ETH, 56=BSC, 501=Solana)
user_walletYesUser's wallet address matching the SOURCE CHAIN. MUST be chain-specific: call dex_wallet_get_addresses(account_id) to get addresses, use addresses["EVM"] for EVM chains or addresses["SOL"] for Solana (chain_id=501). NEVER use an EVM address (0x...) for Solana or a Solana address for EVM chains. For cross-chain swaps this is the FROM (source) chain address.
chain_id_outYesDestination chain ID. Same as chain_id_in for single-chain swap

TDQS

A3.9/5.0
Behavior3/5

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

The description adds value over annotations by clarifying the tool only stages server-side and does not sign or submit. However, with destructiveHint=true, the description provides no explanation of potential side effects (e.g., whether staging invalidates prior quotes or locks funds). It also omits authentication requirements (mcp_token) and session expiration, leaving some behavioral ambiguity.

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?

Two sentences: first states the core action and return value, second clearly separates what it does not do. Every word earns its place; no fluff or redundancy. Front-loaded with the primary function.

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

Completeness3/5

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

For a tool with 12 parameters and no output schema, the description gives the essential purpose and sequencing but lacks guidance on next steps (what to do with swap_session_id), session validity, or handling of cross-chain specifics. The rich schema covers parameters, but the description doesn't explain the full workflow context, making it sufficient but not comprehensive.

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?

Schema description coverage is 100%, with highly detailed parameter descriptions (e.g., native_in/native_out critical warnings, user_wallet chain-specific rules, mcp_token requirement). The tool description itself adds no parameter-level detail beyond returning swap_session_id, so the schema carries the full burden. Baseline 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 uses a specific verb 'Stage a swap session' and clearly distinguishes this tool from its siblings (quote, sign, submit) by stating it is 'server-side build only', returns swap_session_id, and explicitly 'Does not sign or submit'. This leaves no ambiguity about the tool's role in the swap flow.

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?

The instruction 'Call after quote confirmed by user' provides explicit timing guidance, and 'Does not sign or submit' implies the next steps are separate tools (sign/submit). However, it does not explicitly name the alternative sibling tools or mention when not to use this tool (e.g., if a quote is not confirmed).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

TDQS

B3.4/5.0
Disambiguation4/5

Most tools have clear, distinct roles (auth flows, market data, swap stages, wallet operations). A few ambiguities exist, such as dex_tx_get_sol_unsigned vs dex_tx_transfer_preview and dex_agentic_report's name not matching its description, but overall agents can reliably select the correct tool.

Naming Consistency3/5

Naming is inconsistent: while all tools share the dex_ prefix and category segments, some use get_*, others list_*, and several are noun phrases (dex_chain_config, dex_tx_gas, dex_tx_detail). Auth tool ordering also varies (gate_login_start vs login_gate_wallet), making the pattern less predictable.

Tool Count2/5

With 47 tools, the server is over-scoped and burdensome for agents to navigate. Even though the broad DEX domain justifies many features, this exceeds the 25+ threshold for 'too many' and could benefit from consolidation into fewer, higher-level tools.

Completeness4/5

The tool set comprehensively covers DEX workflows: auth, market data, token info, wallet balances, transfer/swap pipeline, cross-chain bridge, and x402 payments. Minor gaps include lack of explicit swap cancellation or withdrawal execution, but these are secondary to the core functionality.