Skip to main content
Glama
blockscout

Blockscout MCP Server

Official

__unlock_blockchain_analysis__

Initialize MCP tools for blockchain data analysis by calling this function. Access and analyze blockchain data effectively while adhering to essential rules for accurate data retrieval and interaction.

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function for the __unlock_blockchain_analysis__ tool. It constructs a comprehensive InstructionsData object containing all server rules, chain guidance, API endpoints, and returns it wrapped in ToolResponse. This tool must be called first to unlock other tools.
    @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)
  • MCP tool registration for __unlock_blockchain_analysis__ using FastMCP's mcp.tool decorator, with custom annotations and structured_output disabled.
    mcp.tool( structured_output=False, annotations=create_tool_annotations("Unlock Blockchain Analysis"), )(__unlock_blockchain_analysis__)
  • Pydantic model InstructionsData defining the structured output schema for the tool, along with supporting models like ChainIdGuidance, DirectApiEndpointList defined earlier in the file.
    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." )

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