Skip to main content
Glama
0xReisearch

REI Crypto MCP Server

by 0xReisearch

get_dex_overview_by_chain

Retrieve decentralized exchange overviews for a specific blockchain, including volume summaries and historical data, to analyze DEX performance and activity.

Instructions

GET /api/overview/dexs/{chain}

List all dexs along with summaries of their volumes and dataType history data filtering by chain. Parameters: chain: chain name (e.g., 'ethereum') exclude_total_data_chart: true to exclude aggregated chart from response exclude_total_data_chart_breakdown: true to exclude broken down chart from response

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chainYes
exclude_total_data_chartNo
exclude_total_data_chart_breakdownNo

Implementation Reference

  • The main handler function decorated with @mcp.tool(), implementing the logic to fetch DEX overview data for a specific chain from the DefiLlama API using the make_request helper. Includes input parameters with type hints serving as schema and comprehensive docstring.
    @mcp.tool() async def get_dex_overview_by_chain( chain: str, exclude_total_data_chart: bool = True, exclude_total_data_chart_breakdown: bool = True ) -> str: """GET /api/overview/dexs/{chain} List all dexs along with summaries of their volumes and dataType history data filtering by chain. Parameters: chain: chain name (e.g., 'ethereum') exclude_total_data_chart: true to exclude aggregated chart from response exclude_total_data_chart_breakdown: true to exclude broken down chart from response """ params = { 'excludeTotalDataChart': str(exclude_total_data_chart).lower(), 'excludeTotalDataChartBreakdown': str(exclude_total_data_chart_breakdown).lower() } result = await make_request('GET', f'/api/overview/dexs/{chain}', params) return str(result)
  • The @mcp.tool() decorator registers the get_dex_overview_by_chain function as an MCP tool.
    @mcp.tool()
  • Docstring providing API endpoint description, parameters, and usage examples, functioning as input/output schema documentation.
    """GET /api/overview/dexs/{chain} List all dexs along with summaries of their volumes and dataType history data filtering by chain. Parameters: chain: chain name (e.g., 'ethereum') exclude_total_data_chart: true to exclude aggregated chart from response exclude_total_data_chart_breakdown: true to exclude broken down chart from response """
  • Shared helper function used by get_dex_overview_by_chain and other tools to perform HTTP requests to the DefiLlama API.
    async def make_request(method: str, endpoint: str, params: Optional[Dict[str, Any]] = None) -> Any: """Make a request to the DefiLlama API.""" try: response = await client.request(method, endpoint, params=params) response.raise_for_status() return response.json() except Exception as e: return f"Error: {str(e)}"

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/0xReisearch/crypto-mcp-beta'

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