get_fees_summary
Retrieve historical fee and revenue summaries for cryptocurrency protocols to analyze financial performance over time.
Instructions
GET /api/summary/fees/{protocol}
Get summary of protocol fees and revenue with historical data.
Parameters:
protocol: protocol slug (e.g., 'lyra')
data_type: desired data type (default: 'dailyFees')
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| protocol | Yes | ||
| data_type | No | dailyFees |
Implementation Reference
- defillama_server.py:875-890 (handler)The primary handler function for the 'get_fees_summary' tool. Decorated with @mcp.tool() for automatic registration in the MCP server. Fetches fees or revenue summary data for a given protocol from the DefiLlama API.@mcp.tool() async def get_fees_summary( protocol: str, data_type: Literal['dailyFees', 'dailyRevenue'] = 'dailyFees' ) -> str: """GET /api/summary/fees/{protocol} Get summary of protocol fees and revenue with historical data. Parameters: protocol: protocol slug (e.g., 'lyra') data_type: desired data type (default: 'dailyFees') """ params = {'dataType': data_type} result = await make_request('GET', f'/api/summary/fees/{protocol}', params) return str(result)
- defillama_server.py:30-38 (helper)Utility function used by the get_fees_summary handler (and other tools) to perform HTTP requests to the DefiLlama Pro 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)}"