get_dex_overview_by_chain
Retrieve a comprehensive overview of decentralized exchanges (DEXs) on a specific blockchain, including volume summaries and historical data, tailored for chain-specific analysis.
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
| Name | Required | Description | Default |
|---|---|---|---|
| chain | Yes | ||
| exclude_total_data_chart | No | ||
| exclude_total_data_chart_breakdown | No |
Implementation Reference
- defillama_server.py:766-786 (handler)The handler function for the 'get_dex_overview_by_chain' tool. It is registered via @mcp.tool() decorator and implements the core logic by preparing parameters and calling the DefiLlama API endpoint '/api/overview/dexs/{chain}' via the make_request helper.@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)
- defillama_server.py:30-37 (helper)Helper function used by the tool handler (and others) to perform HTTP requests to the DefiLlama Pro API using the configured httpx.AsyncClient.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)}"