Skip to main content
Glama

get_swap_quote

Maps to POST /quote. Returns the best swap quote across all integrated DEX protocols, with router, callData, value, price impact, route summary, and gas estimate in one response. Surplus and positive slippage are returned to the user in the same transaction. Supports an optional affiliateCode (registered affiliate wallet address) forwarded to the API so the affiliate fee is paid on-chain to that address. Supports an excludePositions parameter that prices the swap excluding the caller's own LP position from pool state. Returns signable data only; never signs or broadcasts. EXECUTION FLOW: (1) If the input token is non-native, send an ERC-20 approve to the router and WAIT for on-chain confirmation. (2) Call this tool again for a fresh quote (quotes expire). (3) Send the tx to the router contract: to=router, data=callData, value=value. This requires a private key or wallet signer. ⚠️ PRICE IMPACT: The response includes a priceImpact field. Agents MUST present this value to the user and request explicit confirmation before executing. High price impact means the user will receive significantly less value than expected. ⚠️ ZERO OUTPUT: If the swap amount is too small relative to the token pair price ratio, the API returns HTTP 400 with "swap amount too small: output rounds to zero for this pair". Increase the amount or use a different pair.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sideYesQuote direction
amountYesAmount as stringified uint256 in token decimals
chainIdYesEVM chain ID (e.g. 56 for BSC)
tokenInYesInput token address (0x0000...0000 for native coin)
tokenOutYesOutput token address
slippageBpsNoSlippage tolerance in basis points (default: 100 = 1%)
affiliateCodeNoOptional affiliate wallet address registered on-chain with SwapWizard — forwarded to the API so the affiliate fee for this operation is paid to that address. Omit if you have no affiliate.
excludePositionsNoPositions to subtract from pool state during simulation — for a clean quote that excludes self-impact. Get these from list_user_lp_positions.

TDQS

A4.6/5.0
Behavior5/5

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

No annotations provided, so description carries full burden. Discloses read-only nature (returns signable data, never signs/broadcasts), explains approval flow, and warns about potential errors.

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?

Well-structured with front-loaded purpose and bullet points. Slightly verbose but organized effectively with warnings and flow.

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?

Despite no output schema, description details return fields and execution requirements. Complex tool with 8 params is fully explained, including error handling and prerequisite steps.

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 coverage is 100%, baseline 3. Description adds value with context on affiliateCode registration and excludePositions source (list_user_lp_positions), justifying a 4.

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 returns a swap quote from integrated DEX protocols, listing specific fields. It differentiates by mentioning 'best swap quote across all integrated DEX protocols,' distinguishing from siblings like get_clean_quote.

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 execution flow with steps, warnings about price impact and zero output. Lacks explicit comparison to sibling tools but gives clear context for when to use.

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

A4.4/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: pool analysis, health check, quotes (standard and clean), setup guide, chain/DEX info, LP position listing, pool search, and zap in/out. No two tools overlap in functionality.

Naming Consistency4/5

All tool names use snake_case, but the verb prefixes are not uniform: some use 'get_*', others use 'analyze_', 'check_', 'list_', 'search_', 'zap_'. While still clear, a more consistent prefix pattern would improve predictability.

Tool Count5/5

11 tools cover the full scope of a DeFi liquidity management server: discovery, analysis, quoting, entry/exit, and auxiliary info. No redundant tools, and the count is well within the optimal range.

Completeness5/5

The tool surface covers all essential operations for liquidity management: pool search and analysis, swap quotes, position listing, and single-transaction zap in/out. No critical gaps are evident.

Resources