Skip to main content
Glama

dex.liquidity_slippage

Estimate DEX pool liquidity and trade slippage for any trade size. Check total USD liquidity, 24h volume, and slippage tiers to compare pools before swapping.

Instructions

Estimate DEX pool liquidity and trade slippage (GeckoTerminal): total USD
liquidity, 24h volume, an estimated slippage percentage for the given
trade size, and slippage_tiers at fixed $1k/$5k/$10k sizes. Approximated
under a documented constant-product (50:50) assumption since GeckoTerminal's
free API exposes only combined USD liquidity, not per-token reserves.

Also returns quote_token_is_stablecoin (false/null means this pool isn't
USD-quoted - an extra hop is needed to reach USD, not accounted for here),
pool_fee_pct (the pool's swap fee tier, disclosed for reference only - not
subtracted from the slippage estimate), and assumed_gas_cost_usd (a flat
per-network estimate, not a live quote).

Use this before sizing a trade or comparing pools for a given token, to
check depth before swapping. Do NOT treat estimated_slippage_pct or
slippage_tiers as an exact on-chain quote, especially for concentrated-
liquidity or stableswap pools - always re-verify with a live quote before
executing. Requires exactly one of pool_address or token_address; passing
neither raises an "invalid_input" error.

Args:
    trade_size_usd: Hypothetical trade size in USD.
    network: GeckoTerminal network id, e.g. "base", "eth" (default "base").
    pool_address: A specific pool contract address.
    token_address: Token contract address (auto-picks the most liquid pool).
        One of pool_address or token_address is required.

Returns:
    On success: {"success": true, "total_liquidity_usd",
        "estimated_slippage_pct", "slippage_tiers", ...}
    On failure: {"success": false, "error": {"type", "message"}}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
networkNobase
pool_addressNo
token_addressNo
trade_size_usdYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.0.3

TDQS

A5/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden and does so thoroughly. It discloses the constant-product 50:50 assumption, the extra-hop limitation when quote_token_is_stablecoin is false/null, that pool_fee_pct is not subtracted, that gas cost is a flat per-network estimate, and that passing neither address triggers an 'invalid_input' error.

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 long but every section earns its place: the core function, data-source assumptions, caveats, parameter semantics, and return shapes. It is front-loaded and logically organized, with no 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?

For a tool with no output schema and no annotations, the description is remarkably complete. It documents both success and failure return shapes, all caveats about approximation, the dual addressing modes, and the meaning of each returned field. An agent can invoke this tool correctly and interpret its results without further context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate, and it does. The Args section explains trade_size_usd as a hypothetical USD size, network with examples and default, pool_address as a specific contract, and token_address as auto-picking the most liquid pool. It also clarifies the exactly-one-of requirement.

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 opens with a specific verb and resource: 'Estimate DEX pool liquidity and trade slippage (GeckoTerminal)' and enumerates the concrete outputs. It is clearly distinct from all sibling tools, which target different domains like token risk, derivatives, arbitrage, or macro events.

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 explicit guidance: 'Use this before sizing a trade or comparing pools for a given token, to check depth before swapping.' It also states what not to do: 'Do NOT treat estimated_slippage_pct or slippage_tiers as an exact on-chain quote... always re-verify with a live quote before executing.'

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.