Skip to main content
Glama

Get a token swap quote

get_swap_quote
Read-only

No version argument: token swaps are protocol-agnostic and run on the v4 backend, so the chains and tokens they cover are that backend's and not every chain Aave holds a market on - a chain it does not serve is rejected outright rather than quoted badly. Call get_swappable_tokens first if you do not already know the chain is covered, or read 'canSwapFrom' on the reserve from get_markets. Quote a token swap: returns the quote with a quoteId to prepare and sign through prepare_order.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
buyYesToken to buy: 'native' for the chain's gas token, or an ERC-20 address (0x...).
kindNosell = spend an exact sell amount; buy = receive an exact buy amount. Default sell.
sellYesToken to sell: 'native' for the chain's gas token, or an ERC-20 address (0x...).
userYesWallet address (0x, 40 hex) of the wallet that will sign, as the user named it in this session. If no wallet has been named, ask for it; never substitute a placeholder, which is rejected.
amountYesAmount in main units (of the sell token for kind=sell, the buy token for kind=buy).
chainIdYesChain id (positive integer).
slippagePctNoOptional max slippage as a percent string, e.g. '0.5' for 0.5%. Omit to accept the backend's suggestion, which moves with market conditions - set this to cap it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / user / description
      Previous value: -"Wallet address (0x, 40 hex) of the wallet that will sign the swap - the one the user named in this session. If no wallet has been named, ask for it; never substitute a placeholder, which is rejected."New value: +"Wallet address (0x, 40 hex) of the wallet that will sign, as the user named it in this session. If no wallet has been named, ask for it; never substitute a placeholder, which is rejected."
  2. First observed

TDQS

A4.4/5.0
Behavior4/5

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

The quote is explicitly non-mutating ('returns the quote with a quoteId'), aligning with readOnlyHint: true and destructiveHint: false. It also discloses a meaningful behavioral edge case—unsupported chains are rejected outright rather than quoted with poor data—which is not captured in annotations or schema.

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?

The description is information-dense and organized around behavioral caveats, preconditions, and output usage, but opens with a caveat ('No version argument...') before stating the core purpose. The quote purpose is clear and all sentences earn their place, though the main verb-object statement could be front-loaded.

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?

The description covers what the tool does, when to verify chain/token coverage first, what it returns (quote with quoteId), and how the result feeds into prepare_order. Combined with the rich schema, this gives an agent everything needed to invoke it safely and in the correct sequence.

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?

The description does not add parameter-level detail, but the schema already provides thorough descriptions for sell/buy tokens, amount in main units, kind semantics, user validation, and optional slippage. Because schema coverage is near 100%, the lack of additional parameter explanation is acceptable and sits at the baseline for this dimension.

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: 'Quote a token swap: returns the quote with a quoteId to prepare and sign through prepare_order.' It also scopes the tool precisely to the v4 backend's supports chains and explicitly notes unsupported chains are rejected rather than mishandled.

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 gives actionable guidance: call get_swappable_tokens first if chain coverage is unknown, or check 'canSwapFrom' on get_markets. It also explains how to use the returned quoteId downstream with prepare_order, removing ambiguity about the next step.

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