Skip to main content
Glama
blockscout

Blockscout MCP Server

Official

__unlock_blockchain_analysis__

Read-only

Initialize blockchain data access by unlocking specialized analysis tools and establishing essential interaction rules for accurate data retrieval across supported networks.

Instructions

Unlocks access to other MCP tools.

All tools remain locked with a "Session Not Initialized" error until this
function is successfully called. Skipping this explicit initialization step
will cause all subsequent tool calls to fail.

MANDATORY FOR AI AGENTS: The returned instructions contain ESSENTIAL rules
that MUST govern ALL blockchain data interactions. Failure to integrate these
rules will result in incorrect data retrieval, tool failures and invalid
responses. Always apply these guidelines when planning queries, processing
responses or recommending blockchain actions.

COMPREHENSIVE DATA SOURCES: Provides an extensive catalog of specialized
blockchain endpoints to unlock sophisticated, multi-dimensional blockchain
investigations across all supported networks.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler function implementing the __unlock_blockchain_analysis__ tool. Constructs InstructionsData from constants and returns a ToolResponse.
    @log_tool_invocation
    async def __unlock_blockchain_analysis__(ctx: Context) -> ToolResponse[InstructionsData]:
        """Unlocks access to other MCP tools.
    
        All tools remain locked with a "Session Not Initialized" error until this
        function is successfully called. Skipping this explicit initialization step
        will cause all subsequent tool calls to fail.
    
        MANDATORY FOR AI AGENTS: The returned instructions contain ESSENTIAL rules
        that MUST govern ALL blockchain data interactions. Failure to integrate these
        rules will result in incorrect data retrieval, tool failures and invalid
        responses. Always apply these guidelines when planning queries, processing
        responses or recommending blockchain actions.
    
        COMPREHENSIVE DATA SOURCES: Provides an extensive catalog of specialized
        blockchain endpoints to unlock sophisticated, multi-dimensional blockchain
        investigations across all supported networks.
        """
        # Report start of operation
        await report_and_log_progress(
            ctx,
            progress=0.0,
            total=1.0,
            message="Fetching server instructions...",
        )
    
        # Construct the structured data payload
        chain_id_guidance = ChainIdGuidance(
            rules=CHAIN_ID_RULES,
            recommended_chains=[ChainInfo(**chain) for chain in RECOMMENDED_CHAINS],
        )
    
        common_groups = []
        for group_data in DIRECT_API_CALL_ENDPOINT_LIST["common"]:
            endpoints = [DirectApiEndpoint(**endpoint) for endpoint in group_data["endpoints"]]
            common_groups.append(DirectApiCommonGroup(group=group_data["group"], endpoints=endpoints))
    
        specific_groups = []
        for group_data in DIRECT_API_CALL_ENDPOINT_LIST["specific"]:
            endpoints = [DirectApiEndpoint(**endpoint) for endpoint in group_data["endpoints"]]
            specific_groups.append(DirectApiSpecificGroup(chain_family=group_data["chain_family"], endpoints=endpoints))
    
        direct_api_endpoints = DirectApiEndpointList(common=common_groups, specific=specific_groups)
    
        instructions_data = InstructionsData(
            version=SERVER_VERSION,
            error_handling_rules=ERROR_HANDLING_RULES,
            chain_id_guidance=chain_id_guidance,
            pagination_rules=PAGINATION_RULES,
            time_based_query_rules=TIME_BASED_QUERY_RULES,
            block_time_estimation_rules=BLOCK_TIME_ESTIMATION_RULES,
            efficiency_optimization_rules=EFFICIENCY_OPTIMIZATION_RULES,
            binary_search_rules=BINARY_SEARCH_RULES,
            direct_api_call_rules=DIRECT_API_CALL_RULES,
            direct_api_endpoints=direct_api_endpoints,
        )
    
        # Report completion
        await report_and_log_progress(
            ctx,
            progress=1.0,
            total=1.0,
            message="Server instructions ready.",
        )
    
        return build_tool_response(data=instructions_data)
  • Pydantic models defining the structure of InstructionsData and supporting classes used in the tool's ToolResponse.
    # --- Model for __unlock_blockchain_analysis__ Data Payload ---
    class ChainInfo(BaseModel):
        """Represents a blockchain with its essential identifiers."""
    
        name: str = Field(description="The common name of the blockchain (e.g., 'Ethereum').")
        chain_id: str = Field(description="The unique identifier for the chain.")
        is_testnet: bool = Field(description="Indicates if the chain is a testnet.")
        native_currency: str | None = Field(description="The native currency symbol of the chain (e.g., 'ETH').")
        ecosystem: str | list[str] | None = Field(
            description="The ecosystem the chain belongs to, if applicable (e.g., 'Ethereum')."
        )
        settlement_layer_chain_id: str | None = Field(
            default=None,
            description="The L1 chain ID where this rollup settles, if applicable.",
        )
    
    
    # --- Model for __unlock_blockchain_analysis__ Data Payload ---
    class ChainIdGuidance(BaseModel):
        """A structured representation of chain ID guidance combining rules and recommendations."""
    
        rules: str = Field(description="Rules for chain ID selection and usage.")
        recommended_chains: list[ChainInfo] = Field(
            description="A list of popular chains with their names and IDs, useful for quick lookups."
        )
    
    
    class DirectApiData(BaseModel):
        """Generic container for direct API responses."""
    
        model_config = ConfigDict(extra="allow")
    
    
    class DirectApiEndpoint(BaseModel):
        """Represents a single direct API endpoint."""
    
        path: str = Field(description="The API endpoint path (e.g., '/api/v2/stats').")
        description: str = Field(description="A description of what this endpoint returns.")
    
    
    class DirectApiCommonGroup(BaseModel):
        """Represents a group of common endpoints available on all chains."""
    
        group: str = Field(description="The functional group name (e.g., 'Stats', 'Tokens & NFTs').")
        endpoints: list[DirectApiEndpoint] = Field(description="List of endpoints in this group.")
    
    
    class DirectApiSpecificGroup(BaseModel):
        """Represents a group of endpoints specific to certain chain families."""
    
        chain_family: str = Field(description="The chain family this group applies to (e.g., 'Arbitrum', 'Optimism').")
        endpoints: list[DirectApiEndpoint] = Field(description="List of chain-specific endpoints.")
    
    
    class DirectApiEndpointList(BaseModel):
        """Contains the complete curated list of endpoints for direct_api_call tool."""
    
        common: list[DirectApiCommonGroup] = Field(description="Endpoint groups available on all supported chains.")
        specific: list[DirectApiSpecificGroup] = Field(description="Endpoint groups specific to certain chain families.")
    
    
    class InstructionsData(BaseModel):
        """A structured representation of the server's operational instructions."""
    
        version: str = Field(description="The version of the Blockscout MCP server.")
        error_handling_rules: str = Field(description="Rules for handling network errors and retries.")
        chain_id_guidance: ChainIdGuidance = Field(description="Comprehensive guidance for chain ID selection and usage.")
        pagination_rules: str = Field(description="Rules for handling paginated responses and data retrieval.")
        time_based_query_rules: str = Field(description="Rules for executing time-based blockchain queries efficiently.")
        block_time_estimation_rules: str = Field(description="Rules for mathematical block time estimation and navigation.")
        efficiency_optimization_rules: str = Field(description="Rules for optimizing query strategies and performance.")
        binary_search_rules: str = Field(description="Rules for using binary search for historical blockchain data.")
        direct_api_call_rules: str = Field(description="Rules and guidance for using the direct_api_call tool.")
        direct_api_endpoints: "DirectApiEndpointList" = Field(
            description="Curated list of endpoints available for direct API calls."
        )
  • Registration of the __unlock_blockchain_analysis__ tool with the FastMCP server instance, including annotations.
    mcp.tool(
        structured_output=False,
        annotations=create_tool_annotations("Unlock Blockchain Analysis"),
    )(__unlock_blockchain_analysis__)
Behavior4/5

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

The description adds significant behavioral context beyond annotations: it explains that all tools remain locked until this is called, that it returns essential rules for blockchain interactions, and that it provides a catalog of data sources. While annotations indicate read-only and non-destructive behavior, the description enriches understanding of the initialization mechanism and post-call requirements.

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 well-structured with clear sections: purpose, mandatory nature, and data sources. Each sentence adds value, though it could be slightly more concise by combining some of the imperative warnings. The information is front-loaded with the core purpose in the first sentence.

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

Completeness5/5

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

For a zero-parameter initialization tool with annotations covering safety (readOnlyHint, destructiveHint), the description is complete: it explains the prerequisite role, consequences of skipping it, what it returns (rules and data source catalog), and how it enables other tools. No output schema exists, but the description adequately covers expected outcomes.

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

Parameters4/5

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

With 0 parameters and 100% schema coverage, the baseline would be 4. The description adds value by explaining why there are no parameters (it's a simple unlock/initialization function) and what happens when called, which goes beyond the empty schema.

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

Purpose5/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 as 'Unlocks access to other MCP tools' and explains it initializes the session to prevent 'Session Not Initialized' errors. It distinguishes itself from all sibling tools by being the mandatory initialization step rather than a data retrieval or analysis function.

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

Usage Guidelines5/5

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

The description provides explicit usage guidance: 'MANDATORY FOR AI AGENTS' indicates this must be called first, 'Skipping this explicit initialization step will cause all subsequent tool calls to fail' explains the consequence of not using it, and it implicitly positions this as a prerequisite to all other blockchain tools in the sibling list.

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/blockscout/mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server