Skip to main content
Glama

swap_quote

Read-only

Compare ranked routes across providers for a swap, without building or spending anything. Ranked by net value after gas and platform fee, not raw output, with ONE unit price for the output token across every route, so a friendlier price feed can never put a route that delivers fewer tokens on top. Each quote also carries estimatedGas, the gas in units behind the same gasUsd, if you would rather rank against a gas price you read yourself. A quote is only usable by swap_build for about 10-12 seconds — do not hold onto a quoteId and build it later, quote again instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
amountNoHuman decimal amount, e.g. "100". Use this OR amountRaw, not both.
walletNoWallet that will sign. Required for builds and EVM execution/history calls. On an anonymous EVM quote, pass it to make the returned quoteId executable; without it the quote is indicative.
chainIdYesEVM: integer from GET /v1/chains (1, 10, 56, 100, 137, 8453, 42161, 43114, 130). Solana: string from GET /v1/svm/chains ("solana-mainnet").
tokenInYesContract address (Solana: mint), or symbol (case-insensitive). A symbol matching more than one token on this chain fails with ambiguous_token and every candidate — pick the address you meant and retry. On Solana only VERIFIED tokens resolve by symbol, because there anyone can mint a token using another one's symbol; an unverified token has to be named by its mint.
receiverNoOptional: deliver the output to this address instead of the signing wallet. Only providers with supportsReceiver true on the resulting quote honor it — others are left out of quotes[] entirely rather than risk sending to the wrong address. supportsReceiver is present on Solana quotes too, so read it instead of assuming. On Solana, selling into native SOL with a separate destination is refused on every provider (receiver_native_sol_unsupported): closing the wrapped-SOL account sends balance and rent to whoever signs. Ask for wSOL instead.
tokenOutYesContract address, or symbol.
amountRawNoRaw integer string in tokenIn's smallest unit.
slippageBpsNoOptional, a sane per-pair default applies when omitted.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior5/5

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

The description goes well beyond the annotations' readOnly and non-destructive hints. It reveals that no spend occurs, explains the ranking is by net value after gas and platform fees rather than raw output, discloses the single unit price behavior, explains estimatedGas vs gasUsd, and highlights a critical time-sensitive behavior: quoteId is only valid for 10-12 seconds and must not be held. This is rich behavioral context an agent needs beyond what annotations provide.

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 dense but efficient: each sentence earns its place. It leads with the purpose and read-only nature, then explains ranking logic, gas detail, and the critical expiration behavior. No filler or redundancy is present, and the most operationally important warning about quote lifetime is placed at the end where it builds on the previous context.

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?

For a read-only quote tool with no output schema, the description covers the essential behavior: what the quote compares, how routes are ranked, how fees and gas factor in, and the short-lived validity of quoteId. It also routes to the next step (swap_build) and warns against stale quotes. When combined with the fully documented input schema, the definition is complete enough for an agent to invoke this tool correctly.

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%, so the input schema already documents all 8 parameters thoroughly, including chainId types, tokenIn symbols and mint behavior, amount vs amountRaw, receiver constraints, and slippage. The description does not need to add parameter-level meaning and mostly reinforces behavioral concepts like quoteId and gas rather than explaining params. Baseline 3 is appropriate because the schema carries the load.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and object: 'Compare ranked routes across providers for a swap,' which clearly identifies the tool's job. It also distinguishes the quote step from building by saying 'without building or spending anything' and references swap_build as the consumer. It does not explicitly differentiate from sibling quote tools like double_quote or nn_quote, but the 'across providers' framing and comparison emphasis provide enough clarity.

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 description makes the usage context clear: call this before building or spending, and use the returned quote as input to swap_build. It also gives explicit temporal guidance not to hold a quoteId because quotes expire in 10-12 seconds and to quote again instead. It does not systematically state when NOT to use this tool versus the other quote siblings, so it stops short of full alternative-comparison guidance.

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