get_dex_summary
Retrieve DEX volume summaries with historical data for specific protocols like Uniswap. Access aggregated and broken-down chart data to analyze decentralized exchange performance.
Instructions
GET /api/summary/dexs/{protocol}
Get summary of dex volume with historical data.
Parameters:
protocol: protocol slug (e.g., 'uniswap')
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 |
|---|---|---|---|
| protocol | Yes | ||
| exclude_total_data_chart | No | ||
| exclude_total_data_chart_breakdown | No |
Implementation Reference
- defillama_server.py:788-808 (handler)The main handler function for the 'get_dex_summary' MCP tool. It is decorated with @mcp.tool() for registration and implements the logic to query the DefiLlama API endpoint /api/summary/dexs/{protocol}, constructing parameters for chart exclusions, making an async HTTP request via the shared make_request helper, and returning the JSON response as a string.@mcp.tool() async def get_dex_summary( protocol: str, exclude_total_data_chart: bool = True, exclude_total_data_chart_breakdown: bool = True ) -> str: """GET /api/summary/dexs/{protocol} Get summary of dex volume with historical data. Parameters: protocol: protocol slug (e.g., 'uniswap') 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/summary/dexs/{protocol}', params) return str(result)