Skip to main content
Glama
ymylive
by ymylive

list_dex_volumes

List top decentralized exchanges ranked by 24-hour trading volume, with 1d/7d/30d change percentages to identify momentum and compare protocols like Uniswap vs PancakeSwap.

Instructions

List DEXes ranked by 24-hour trading volume.

Use for "biggest DEXes by volume", "Uniswap vs PancakeSwap volume", or to see momentum (each entry includes 1d/7d/30d change percentages). Pair with CCXT's get_exchange_ticker for centralized-exchange volumes.

Args: limit: Number of DEXes to return (1..200).

Returns: Object with a summary (totals across all DEXes: total24h, total7d, total30d, change_1d, change_7d, change_1m) and protocols — an array of name, displayName, slug, category, chains, total24h, total7d, total30d, total1y, totalAllTime, change_1d, change_7d, change_1m.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo

Implementation Reference

  • The actual tool handler for 'list_dex_volumes'. Fetches DEX overview data from DefiLlama API, sorts by 24h volume, and returns a summary + trimmed protocol list.
    @mcp.tool()
    async def list_dex_volumes(limit: int = 30) -> Any:
        """List DEXes ranked by 24-hour trading volume.
    
        Use for "biggest DEXes by volume", "Uniswap vs PancakeSwap volume", or to
        see momentum (each entry includes 1d/7d/30d change percentages). Pair with
        CCXT's `get_exchange_ticker` for centralized-exchange volumes.
    
        Args:
            limit: Number of DEXes to return (1..200).
    
        Returns:
            Object with a `summary` (totals across all DEXes: `total24h`,
            `total7d`, `total30d`, `change_1d`, `change_7d`, `change_1m`) and
            `protocols` — an array of `name`, `displayName`, `slug`, `category`,
            `chains`, `total24h`, `total7d`, `total30d`, `total1y`, `totalAllTime`,
            `change_1d`, `change_7d`, `change_1m`.
        """
        data = await _http_get(
            f"{DEFILLAMA_BASE}/overview/dexs",
            params={
                "excludeTotalDataChart": "true",
                "excludeTotalDataChartBreakdown": "true",
            },
        )
        if is_error(data):
            return data
        if not isinstance(data, dict):
            return {"error": "unexpected response", "type": type(data).__name__}
    
        protocols = data.get("protocols") or []
        if not isinstance(protocols, list):
            return {"error": "unexpected protocols shape"}
    
        protocols = sorted(protocols, key=lambda p: _sort_key(p.get("total24h")))
        limit = max(1, min(limit, 200))
    
        keep = (
            "name", "displayName", "slug", "category", "chains",
            "total24h", "total7d", "total30d", "total1y", "totalAllTime",
            "change_1d", "change_7d", "change_1m",
        )
        return {
            "summary": {
                "total24h": data.get("total24h"),
                "total7d": data.get("total7d"),
                "total30d": data.get("total30d"),
                "change_1d": data.get("change_1d"),
                "change_7d": data.get("change_7d"),
                "change_1m": data.get("change_1m"),
            },
            "protocols": [{k: p.get(k) for k in keep} for p in protocols[:limit]],
        }
  • The @mcp.tool() decorator registers the async function as an MCP tool named 'list_dex_volumes'.
    @mcp.tool()
  • Function signature and docstring define the schema: accepts optional 'limit' (int, default 30, range 1-200) and returns an object with 'summary' and 'protocols' fields.
    async def list_dex_volumes(limit: int = 30) -> Any:
        """List DEXes ranked by 24-hour trading volume.
    
        Use for "biggest DEXes by volume", "Uniswap vs PancakeSwap volume", or to
        see momentum (each entry includes 1d/7d/30d change percentages). Pair with
        CCXT's `get_exchange_ticker` for centralized-exchange volumes.
    
        Args:
            limit: Number of DEXes to return (1..200).
    
        Returns:
            Object with a `summary` (totals across all DEXes: `total24h`,
            `total7d`, `total30d`, `change_1d`, `change_7d`, `change_1m`) and
            `protocols` — an array of `name`, `displayName`, `slug`, `category`,
            `chains`, `total24h`, `total7d`, `total30d`, `total1y`, `totalAllTime`,
            `change_1d`, `change_7d`, `change_1m`.
        """
  • Registration/listing of the tool in the core catalog. Maps description 'DEX 24h volume rankings' to tool name 'list_dex_volumes'.
    | DEX 24h volume rankings | list_dex_volumes |
Behavior4/5

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

With no annotations, description details return structure and change percentages, but could mention rate limits or update frequency.

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?

Well-structured with usage, args, returns; slightly verbose in returns but overall efficient.

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?

Comprehensive for a simple list tool: purpose, usage, param, and detailed output; no missing essential info.

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?

Adds range and clarification beyond schema (1..200, number of DEXes), compensating for 0% schema description coverage.

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?

Clearly states 'List DEXes ranked by 24-hour trading volume' with example queries, distinguishing from sibling 'dex_search'.

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?

Provides explicit use cases and suggests pairing with 'get_exchange_ticker' for centralized exchanges, but lacks explicit when-not-to-use.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ymylive/coin-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server