Skip to main content
Glama

Get Dex Quote

get_dex_quote
Read-only

Get the best Uniswap v3 swap quote on Ethereum (chain_id=1) or Base (chain_id=8453) via direct on-chain QuoterV2 calls. Queries all four fee tiers (100/500/3000/10000 bps) in parallel and returns the tier with the highest output amount, along with per-tier breakdown. Inputs are raw uint256 amounts and EIP-55 checksummed addresses; native ETH is not quoted directly — pass the WETH address. Returns no_liquidity=true when no pool exists for the pair. Point-in-time quote at the returned block_number; do not cache.

Use when: Choose when you need a best-execution Uniswap v3 swap quote on Ethereum or Base before executing a trade — e.g. price impact, output amount, or route selection.

Limitations: Quotes raw uint256 amounts with EIP-55 checksummed addresses only; native ETH is not quoted directly (pass WETH). Point-in-time at the returned block_number — do not cache.

Alternatives: get_token_price, get_dex_volume

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chain_idNo1 = Ethereum mainnet, 8453 = Base mainnet. Other chains unsupported.
token_inYesEIP-55 checksummed address of the token being sold. For native ETH, pass the WETH address (Ethereum: 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; Base: 0x4200000000000000000000000000000000000006).
amount_inYesInput amount in RAW uint256 units (e.g. '1000000' for 1 USDC, '1000000000000000000' for 1 WETH). Must be > 0 and < 2^128. Common token decimals: WETH/ETH/DAI/wstETH/cbETH/weETH 18, WBTC/cbBTC 8, USDC/USDT 6. Do not call read_contract to look up decimals — use these values directly.
token_outYesEIP-55 checksummed address of the token being bought.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
chain_idYes
token_inYes
amount_inYes
token_outYes
amount_outYes
block_numberYes
no_liquidityYes
fee_tier_usedYes
effective_rateYes
quotes_per_tierYes
amount_out_humanYes
amount_in_decimalsYes
amount_out_decimalsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed12 schema fields changed
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / amount_in / title
      Added value: +"Amount In"
    • addedInput schema / properties / chain_id / title
      Added value: +"Chain Id"
    • addedInput schema / properties / token_in / title
      Added value: +"Token In"
    • addedInput schema / properties / token_out / title
      Added value: +"Token Out"
    • addedInput schema / title
      Added value: +"mcp_get_dex_quoteArguments"
    • addedOutput schema / $defs
      Added value: +{
      +  "TierQuote": {
      +    "properties": {
      +      "amount_out": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "title": "Amount Out"
      +      },
      +      "error": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "title": "Error"
      +      },
      +      "fee_tier": {
      +        "title": "Fee Tier",
      +        "type": "integer"
      +      },
      +      "gas_estimate": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "title": "Gas Estimate"
      +      },
      +      "sqrt_price_x96_after": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "title": "Sqrt Price X96 After"
      +      },
      +      "success": {
      +        "title": "Success",
      +        "type": "boolean"
      +      }
      +    },
      +    "required": [
      +      "fee_tier",
      +      "success"
      +    ],
      +    "title": "TierQuote",
      +    "type": "object"
      +  }
      +}
    • addedOutput schema / properties / quotes_per_tier / items / $ref
      Added value: +"#/$defs/TierQuote"
    • removedOutput schema / properties / quotes_per_tier / items / properties
      Removed value: -{
      -  "amount_out": {
      -    "anyOf": [
      -      {
      -        "type": "string"
      -      },
      -      {
      -        "type": "null"
      -      }
      -    ],
      -    "default": null,
      -    "title": "Amount Out"
      -  },
      -  "error": {
      -    "anyOf": [
      -      {
      -        "type": "string"
      -      },
      -      {
      -        "type": "null"
      -      }
      -    ],
      -    "default": null,
      -    "title": "Error"
      -  },
      -  "fee_tier": {
      -    "title": "Fee Tier",
      -    "type": "integer"
      -  },
      -  "gas_estimate": {
      -    "anyOf": [
      -      {
      -        "type": "string"
      -      },
      -      {
      -        "type": "null"
      -      }
      -    ],
      -    "default": null,
      -    "title": "Gas Estimate"
      -  },
      -  "sqrt_price_x96_after": {
      -    "anyOf": [
      -      {
      -        "type": "string"
      -      },
      -      {
      -        "type": "null"
      -      }
      -    ],
      -    "default": null,
      -    "title": "Sqrt Price X96 After"
      -  },
      -  "success": {
      -    "title": "Success",
      -    "type": "boolean"
      -  }
      -}
    • removedOutput schema / properties / quotes_per_tier / items / required
      Removed value: -[
      -  "fee_tier",
      -  "success"
      -]
    • removedOutput schema / properties / quotes_per_tier / items / title
      Removed value: -"TierQuote"
    • removedOutput schema / properties / quotes_per_tier / items / type
      Removed value: -"object"
  2. First observed

TDQS

A4.8/5.0
Behavior5/5

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

While the annotation readOnlyHint=true already indicates a safe read, the description adds substantial behavioral context: it is a point-in-time quote, should not be cached, returns no_liquidity=true when no pool exists, and provides a per-tier breakdown. It also warns about native ETH and the need to pass WETH. These details go beyond the annotation and help the agent use the tool correctly.

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 organized into clear sections (function, use when, limitations, alternatives) and front-loads the core purpose. However, some redundancy exists: the limitations section repeats the native ETH and point-in-time constraints already mentioned in the first paragraph. A lighter rewrite would tighten it, but the structure is still effective and each section earns its place.

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?

Given the output schema exists (which presumably details the return structure), the description covers all necessary operational aspects: supported chains, fee tiers, input format requirements, caching warning, and alternative tools. Nothing an agent needs to invoke the tool correctly is missing. Even without the output schema, the description would be fairly complete, and with it, it is fully sufficient.

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 description coverage is 100%, so the baseline is 3. The description enriches parameter usage with practical examples: it explains raw uint256 and gives common token decimals for amount_in, provides specific WETH addresses for native ETH, and explicitly instructs not to call read_contract for decimals. This substantially improves usability beyond the schema's own descriptions, hence 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 a specific verb+resource: 'Get the best Uniswap v3 swap quote on Ethereum or Base via direct on-chain QuoterV2 calls.' It enumerates the chains, the mechanism (QuoterV2), the fee tiers, and the selection criterion (highest output amount). It also distinguishes itself from siblings by naming alternatives (get_token_price, get_dex_volume) and stating exactly what it returns, so an agent can tell it apart without opening schemas.

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?

Provides an explicit 'Use when' section that specifies the intended context: 'when you need a best-execution Uniswap v3 swap quote on Ethereum or Base before executing a trade.' It also lists alternatives and their roles, making clear when to prefer this tool versus get_token_price or get_dex_volume. The guidance is direct and actionable.

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