Skip to main content
Glama
0xReisearch

REI Crypto MCP Server

by 0xReisearch

get_historical_liquidity

Retrieve historical liquidity data for token swaps on specific blockchain networks to analyze trading conditions and market depth over time.

Instructions

GET /api/historicalLiquidity/{token}

Provides the available liquidity for swapping from one token to another on a specific chain.

Parameters:
    token: token slug (e.g., 'usdt')

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tokenYes

Implementation Reference

  • The tool handler for 'get_historical_liquidity'. Decorated with @mcp.tool() for registration. Takes a token slug, queries the DefiLlama API for historical liquidity data, and returns the JSON response as a string.
    @mcp.tool()
    async def get_historical_liquidity(token: str) -> str:
        """GET /api/historicalLiquidity/{token}
        
        Provides the available liquidity for swapping from one token to another on a specific chain.
        
        Parameters:
            token: token slug (e.g., 'usdt')
        """
        result = await make_request('GET', f'/api/historicalLiquidity/{token}')
        return str(result)
  • Shared helper function used by get_historical_liquidity (and other tools) 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