Skip to main content
Glama
0xReisearch

REI Crypto MCP Server

by 0xReisearch

get_batch_historical_prices

Retrieve historical price data for multiple tokens at specified timestamps with adjustable search width. Ideal for analyzing crypto asset performance across different timeframes.

Instructions

GET /coins/batchHistorical

Get historical prices for multiple tokens at multiple different timestamps. Parameters: coins: dict where keys are coins in format {chain}:{address} and values are arrays of timestamps search_width: time range on either side to find price data (default: '6h')

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
coinsYes
search_widthNo6h

Implementation Reference

  • The handler function that implements the get_batch_historical_prices tool. It constructs parameters from the input coins dictionary and search_width, makes an API request to DefiLlama's /coins/batchHistorical endpoint using the shared make_request helper, and returns the stringified result.
    async def get_batch_historical_prices( coins: Dict[str, List[int]], search_width: str = "6h" ) -> str: """GET /coins/batchHistorical Get historical prices for multiple tokens at multiple different timestamps. Parameters: coins: dict where keys are coins in format {chain}:{address} and values are arrays of timestamps search_width: time range on either side to find price data (default: '6h') """ params = { 'coins': str(coins), 'searchWidth': search_width } result = await make_request('GET', '/coins/batchHistorical', params) return str(result)
  • The @mcp.tool() decorator registers the get_batch_historical_prices function as an MCP tool.
    @mcp.tool()

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