Skip to main content
Glama

dex.liquidity_slippage

Read-only

Use this tool to calculate expected DEX price slippage, pool liquidity depth, and optimal routing before executing an on-chain token swap. GeckoTerminal-backed pool analytics with constant-product slippage estimation for the requested trade_size_usd, plus a slippage_tiers array with the same estimate at fixed $1,000/$5,000/$10,000 sizes so an agent can gauge depth at a glance without extra calls. When called with token_address, also returns direct_stablecoin_pool_exists and, when the selected pool isn't USD-quoted, alternate_direct_pool - a different pool for the same token that is, so you know before swapping whether a multi-hop route is actually required or whether a direct pool exists elsewhere. Do not use for centralized exchange (CEX) orderbooks or contract risk analysis. Paid in USDC on Base.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
networkNoGeckoTerminal network id, e.g. base, eth. Defaults to base.
pool_addressNoSpecific DEX pool contract address (optional if token_address is given).
token_addressNoToken contract address - the most liquid pool is auto-selected (optional if pool_address is given).
trade_size_usdYesHypothetical trade size in USD to estimate slippage for.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
noticeNo
networkYes
pool_nameNo
data_sourceYes
generated_atYes
pool_addressNo
pool_fee_pctNoSwap fee tier of the selected pool, parsed from pool_name. Disclosed for reference only - not subtracted from the slippage estimate.
liquidity_usdNo
token_addressNo
slippage_tiersNo
trade_size_usdYes
volume_24h_usdNo
price_impact_modelYes
quote_token_symbolNoParsed from pool_name (e.g. 'USDC' from 'WETH / USDC 0.05%').
assumed_gas_cost_usdNoFlat per-swap gas estimate for this network, not a live gas quote.
alternate_direct_poolNoOnly set when quote_token_is_stablecoin is false/null AND a stablecoin-quoted pool exists elsewhere for this token - lets you re-query with that pool_address instead of assuming a multi-hop route.
estimated_slippage_pctNo
quote_token_is_stablecoinNoIf false or null, this pool isn't USD-quoted - an extra hop is needed to reach USD, not accounted for in the slippage estimate.
direct_stablecoin_pool_existsNoWhether ANY pool for this token (not just the one selected above) is quoted directly against a USD stablecoin. Null when pool_address was passed directly (no full pool list was fetched).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedOutput schema / properties / alternate_direct_pool
      Added value: +{
      +  "description": "Only set when quote_token_is_stablecoin is false/null AND a stablecoin-quoted pool exists elsewhere for this token - lets you re-query with that pool_address instead of assuming a multi-hop route.",
      +  "properties": {
      +    "liquidity_usd": {
      +      "type": [
      +        "number",
      +        "null"
      +      ]
      +    },
      +    "pool_address": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "pool_name": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "quote_token_symbol": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    }
      +  },
      +  "type": [
      +    "object",
      +    "null"
      +  ]
      +}
    • addedOutput schema / properties / direct_stablecoin_pool_exists
      Added value: +{
      +  "description": "Whether ANY pool for this token (not just the one selected above) is quoted directly against a USD stablecoin. Null when pool_address was passed directly (no full pool list was fetched).",
      +  "type": [
      +    "boolean",
      +    "null"
      +  ]
      +}
  2. Changed4 schema fields changed
    • addedOutput schema / properties / assumed_gas_cost_usd
      Added value: +{
      +  "description": "Flat per-swap gas estimate for this network, not a live gas quote.",
      +  "type": [
      +    "number",
      +    "null"
      +  ]
      +}
    • addedOutput schema / properties / pool_fee_pct
      Added value: +{
      +  "description": "Swap fee tier of the selected pool, parsed from pool_name. Disclosed for reference only - not subtracted from the slippage estimate.",
      +  "type": [
      +    "number",
      +    "null"
      +  ]
      +}
    • addedOutput schema / properties / quote_token_is_stablecoin
      Added value: +{
      +  "description": "If false or null, this pool isn't USD-quoted - an extra hop is needed to reach USD, not accounted for in the slippage estimate.",
      +  "type": [
      +    "boolean",
      +    "null"
      +  ]
      +}
    • addedOutput schema / properties / quote_token_symbol
      Added value: +{
      +  "description": "Parsed from pool_name (e.g. 'USDC' from 'WETH / USDC 0.05%').",
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
  3. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare a safe read-only, non-destructive operation, so the description's job is to add context beyond that. It does: constant-product estimation methodology, the fixed-size slippage_tiers precomputation, conditional extra fields when token_address is supplied, and the non-obvious 'Paid in USDC on Base' cost/auth requirement. It doesn't cover rate limits or latency, but the payment disclosure is a meaningful addition.

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 purpose, then conditional return behavior, then exclusions and payment. Sentences are dense but each carries information. The middle sentence about slippage_tiers is slightly long-winded, but nothing is filler.

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?

With an output schema present, the description need not enumerate return values, yet it still flags the non-obvious conditional ones. Combined with usage boundaries, payment model, and methodology, an agent has everything needed to select and invoke this correctly.

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%, so the baseline is 3. The description goes further by explaining conditional parameter behavior: supplying token_address triggers direct_stablecoin_pool_exists and alternate_direct_pool, and clarifies the pool_address/token_address auto-selection tradeoff. That interaction detail is not fully conveyed by the schema alone.

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 three concrete outputs: 'calculate expected DEX price slippage, pool liquidity depth, and optimal routing.' It also fences off adjacent territory by excluding CEX orderbooks and contract risk analysis, which separates it from security.* siblings. It stops short of naming a sibling tool directly, so 4 rather than 5.

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?

Usage context is explicit ('before executing an on-chain token swap') and exclusions are stated ('Do not use for centralized exchange (CEX) orderbooks or contract risk analysis'). What's missing is a named alternative tool for those excluded cases, which is the only thing keeping this from a 5.

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.