Skip to main content
Glama
0xReisearch

REI Crypto MCP Server

by 0xReisearch

get_historical_prices

Retrieve historical cryptocurrency prices by contract address and timestamp using the MCP server's API. Specify tokens, time, and search range for accurate price data.

Instructions

GET /coins/prices/historical/{timestamp}/{coins}

Get historical prices of tokens by contract address. Parameters: timestamp: UNIX timestamp for historical prices coins: comma-separated tokens in format {chain}:{address} search_width: time range on either side to find price data (default: '6h')

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
coinsYes
search_widthNo6h
timestampYes

Implementation Reference

  • The handler function for the 'get_historical_prices' tool. It is registered via the @mcp.tool() decorator and implements the logic to fetch historical prices from the DefiLlama API endpoint /coins/prices/historical/{timestamp}/{coins}, using the shared make_request helper.
    @mcp.tool() async def get_historical_prices( timestamp: int, coins: str, search_width: str = "6h" ) -> str: """GET /coins/prices/historical/{timestamp}/{coins} Get historical prices of tokens by contract address. Parameters: timestamp: UNIX timestamp for historical prices coins: comma-separated tokens in format {chain}:{address} search_width: time range on either side to find price data (default: '6h') """ params = {'searchWidth': search_width} result = await make_request('GET', f'/coins/prices/historical/{timestamp}/{coins}', params) return str(result)

Other Tools

Related Tools

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