get_protocol_tvl
Retrieve the current Total Value Locked (TVL) for a specific DeFi protocol by providing its slug. Simplify TVL data access without managing individual API keys.
Instructions
GET /api/tvl/{protocol}
Simplified endpoint to get current TVL of a protocol.
Parameters:
protocol: protocol slug (e.g., 'uniswap')
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| protocol | Yes |
Implementation Reference
- defillama_server.py:115-125 (handler)Handler function for the 'get_protocol_tvl' tool. Decorated with @mcp.tool() for registration in MCP. Takes a protocol slug, fetches current TVL from DefiLlama API endpoint /api/tvl/{protocol}, and returns the result as string.@mcp.tool() async def get_protocol_tvl(protocol: str) -> str: """GET /api/tvl/{protocol} Simplified endpoint to get current TVL of a protocol. Parameters: protocol: protocol slug (e.g., 'uniswap') """ result = await make_request('GET', f'/api/tvl/{protocol}') return str(result)