Skip to main content
Glama
0xReisearch

REI Crypto MCP Server

by 0xReisearch

get_historical_chain_tvl_by_chain

Retrieve historical total value locked (TVL) data for a specific blockchain, excluding liquid staking and double-counted TVL, using a chain slug as input. Available via the REI Crypto MCP Server.

Instructions

GET /api/v2/historicalChainTvl/{chain}

Get historical TVL (excludes liquid staking and double counted tvl) of a chain. Parameters: chain: chain slug (e.g., 'Ethereum')

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chainYes

Implementation Reference

  • The main handler function for the tool 'get_historical_chain_tvl_by_chain'. It is registered via the @mcp.tool() decorator. The function makes an API request to DefiLlama for historical TVL data of the specified chain and returns the result as a string. The input schema is defined by the function parameter 'chain: str' and the docstring.
    @mcp.tool() async def get_historical_chain_tvl_by_chain(chain: str) -> str: """GET /api/v2/historicalChainTvl/{chain} Get historical TVL (excludes liquid staking and double counted tvl) of a chain. Parameters: chain: chain slug (e.g., 'Ethereum') """ result = await make_request('GET', f'/api/v2/historicalChainTvl/{chain}') return str(result)
  • The @mcp.tool() decorator registers the function as an MCP tool with the name matching the function name.
    @mcp.tool()
  • Docstring provides the tool description and parameter schema (chain: str).
    """GET /api/v2/historicalChainTvl/{chain} Get historical TVL (excludes liquid staking and double counted tvl) of a chain. Parameters: chain: chain slug (e.g., 'Ethereum') """
  • Shared helper function used by the tool to make 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