Skip to main content
Glama
0xReisearch

REI Crypto MCP Server

by 0xReisearch

get_closest_block

Retrieve the closest blockchain block for a specific timestamp using a chain identifier. Simplify timestamp-based block queries for crypto data analysis and retrieval.

Instructions

GET /coins/block/{chain}/{timestamp}

Get the closest block to a timestamp. Parameters: chain: chain identifier timestamp: UNIX timestamp to find closest block for

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chainYes
timestampYes

Implementation Reference

  • Handler and registration for the 'get_closest_block' tool. Queries DefiLlama API for the closest block to a given timestamp on a specified chain.
    @mcp.tool() async def get_closest_block(chain: str, timestamp: int) -> str: """GET /coins/block/{chain}/{timestamp} Get the closest block to a timestamp. Parameters: chain: chain identifier timestamp: UNIX timestamp to find closest block for """ result = await make_request('GET', f'/coins/block/{chain}/{timestamp}') return str(result)

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