Skip to main content
Glama

Swap quote, best DEX route

swap_quote
Read-only

Best price to swap one token for another on 30+ chains (Base, Ethereum, Arbitrum, Solana, BSC…) across DEX aggregators, via LI.FI: amount out, minimum after slippage, USD values, gas and fees, total cost in percent, route and approval address; with fromAddress, the unsigned transaction for your wallet to sign. Tokens by symbol or address, amounts in token units. A quote only: nothing is signed or sent. Use before a trading agent swaps. Example: fromChain=base, fromToken=USDC, amount=1000, toToken=ETH. Price $0.01/call via x402 USDC or a card key (/credits), first 25 free; failed calls free. Reads or computes only and changes nothing; each call is charged, so repeats are not free.

Input Schema

NameRequiredDescriptionDefault
amountYesAmount of fromToken in token units, e.g. 100 or 0.5
toTokenYesToken to buy: symbol or address
slippageNoSlippage tolerance in percent (default 0.5)
fromChainYesChain name or id: base, ethereum, arbitrum, solana…
fromTokenYesToken to sell: symbol (USDC, ETH) or address
toAddressNoOptional receiving wallet, e.g. a Solana address when bridging to Solana
fromAddressNoOptional wallet that would send: adds the unsigned transaction to the answer

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, and idempotentHint=false; the description reinforces that nothing is signed or sent and explains the non-idempotent flag's practical meaning (every call is billed, failures are free, first 25 free, $0.01/call via x402). That cost/rate-limit disclosure is real added value beyond structured fields. It does not cover latency, quote expiry, or rate limiting under load, keeping it below a 5.

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?

Front-loaded with the core value proposition and output list, then usage, then pricing; nothing is padding. The single dense sentence with semicolon-chained clauses and the trailing pricing/redisclosure of read-only behavior make it slightly harder to scan than it needs to be, but it stays proportionate to the tool's surface.

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?

No output schema exists, so the description compensates by enumerating return fields, and it also covers safety (quote-only), cost, and the fromAddress transaction behavior. For a 7-parameter financial quote tool an agent has everything needed to decide to call it and to interpret the response shape.

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?

With schema coverage at 100% the baseline is 3, but the description adds semantics the schema does not: 'Tokens by symbol or address,' 'amounts in token units,' and crucially that fromAddress makes the response include an unsigned transaction for the wallet to sign. A concrete example (fromChain=base, fromToken=USDC, amount=1000, toToken=ETH) further anchors the required params.

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?

States a specific verb and resource (best-price swap quote across 30+ chains via LI.FI) and enumerates concrete outputs (amount out, min after slippage, gas/fees, route, approval address). It is readily distinguishable from the sibling bridge_quote by framing itself as a same-pair swap price, and the parenthetical chain list plus a worked example remove ambiguity.

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?

Gives clear usage context: 'Use before a trading agent swaps' and 'A quote only: nothing is signed or sent,' which tells the agent this is a pre-trade read step. It does not explicitly name an alternative or exclusion (e.g. use bridge_quote when moving a token across chains), so it stops short of full when/when-not routing.

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.

Resources