Skip to main content
Glama
0xReisearch

REI Crypto MCP Server

by 0xReisearch

get_closest_block

Find the blockchain block nearest to a specific UNIX timestamp for a given cryptocurrency chain identifier.

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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the 'get_closest_block' MCP tool. It uses the shared 'make_request' helper to query the DefiLlama API endpoint '/coins/block/{chain}/{timestamp}' and returns the closest block number for the given chain and timestamp as a string.
    @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)
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must fully disclose behavioral traits. It states the action ('Get the closest block') but doesn't explain what 'closest' means (e.g., before, after, or nearest in time), potential errors (e.g., invalid chain or timestamp), rate limits, or authentication needs. This is insufficient for a tool with no annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded: the first sentence states the purpose clearly, followed by a URL and parameter list. There's no wasted text, but the structure could be slightly improved by integrating the URL more seamlessly. Overall, it's efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (2 required parameters) and the presence of an output schema, the description is partially complete. It covers the basic purpose and parameters but lacks behavioral context and usage guidelines. The output schema likely handles return values, so the description doesn't need to explain those, but it should address other gaps like error handling or constraints.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, but the description compensates by listing parameters with brief explanations: 'chain: chain identifier' and 'timestamp: UNIX timestamp to find closest block for.' This adds meaning beyond the schema's generic titles. However, it doesn't detail valid chain values or timestamp constraints, leaving gaps. With 0% coverage, baseline is lower, but the description provides some value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Get the closest block to a timestamp.' It specifies the verb ('Get') and resource ('closest block'), and the URL path '/coins/block/{chain}/{timestamp}' reinforces this. However, it doesn't differentiate from sibling tools, which appear unrelated (e.g., get_active_users, get_historical_prices), so it's not a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It lacks context about prerequisites, such as valid chain identifiers or timestamp ranges, and doesn't mention any sibling tools that might serve similar purposes. This leaves the agent without usage direction.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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