Skip to main content
Glama
blockscout

Blockscout MCP Server

Official

get_address_info

Read-only

Retrieve blockchain address details including balance, contract status, token information, and proxy data for analysis and investigation.

Instructions

Get comprehensive information about an address, including:
- Address existence check
- Native token (ETH) balance (provided as is, without adjusting by decimals)
- ENS name association (if any)
- Contract status (whether the address is a contract, whether it is verified)
- Proxy contract information (if applicable): determines if a smart contract is a proxy contract (which forwards calls to implementation contracts), including proxy type and implementation addresses
- Token details (if the contract is a token): name, symbol, decimals, total supply, etc.
Essential for address analysis, contract investigation, token research, and DeFi protocol analysis.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chain_idYesThe ID of the blockchain
addressYesAddress to get information about

Implementation Reference

  • The main asynchronous handler function for the get_address_info tool. It fetches address data from Blockscout API and metadata service, constructs AddressInfoData, and returns a standardized ToolResponse.
    @log_tool_invocation
    async def get_address_info(
        chain_id: Annotated[str, Field(description="The ID of the blockchain")],
        address: Annotated[str, Field(description="Address to get information about")],
        ctx: Context,
    ) -> ToolResponse[AddressInfoData]:
        """
        Get comprehensive information about an address, including:
        - Address existence check
        - Native token (ETH) balance (provided as is, without adjusting by decimals)
        - ENS name association (if any)
        - Contract status (whether the address is a contract, whether it is verified)
        - Proxy contract information (if applicable): determines if a smart contract is a proxy contract (which forwards calls to implementation contracts), including proxy type and implementation addresses
        - Token details (if the contract is a token): name, symbol, decimals, total supply, etc.
        Essential for address analysis, contract investigation, token research, and DeFi protocol analysis.
        """  # noqa: E501
        await report_and_log_progress(
            ctx, progress=0.0, total=3.0, message=f"Starting to fetch address info for {address} on chain {chain_id}..."
        )
    
        base_url = await get_blockscout_base_url(chain_id)
        await report_and_log_progress(
            ctx, progress=1.0, total=3.0, message="Resolved Blockscout instance URL. Fetching data..."
        )
    
        blockscout_api_path = f"/api/v2/addresses/{address}"
        metadata_api_path = "/api/v1/metadata"
        metadata_params = {"addresses": address, "chainId": chain_id}
    
        address_info_result, metadata_result = await asyncio.gather(
            make_blockscout_request(base_url=base_url, api_path=blockscout_api_path),
            make_metadata_request(api_path=metadata_api_path, params=metadata_params),
            return_exceptions=True,
        )
    
        if isinstance(address_info_result, Exception):
            raise address_info_result
    
        await report_and_log_progress(ctx, progress=2.0, total=3.0, message="Fetched basic address info.")
    
        notes = None
        if isinstance(metadata_result, Exception):
            notes = [f"Could not retrieve address metadata. The 'metadata' field is null. Error: {metadata_result}"]
            metadata_data = None
        elif metadata_result.get("addresses"):
            address_key = next(
                (key for key in metadata_result["addresses"] if key.lower() == address.lower()),
                None,
            )
            metadata_data = metadata_result["addresses"].get(address_key) if address_key else None
        else:
            metadata_data = None
    
        address_data = AddressInfoData(basic_info=address_info_result, metadata=metadata_data)
    
        await report_and_log_progress(ctx, progress=3.0, total=3.0, message="Successfully fetched all address data.")
        instructions = [
            (f"Use `direct_api_call` with endpoint `/api/v2/addresses/{address}/logs` to get Logs Emitted by Address."),
            (
                f"Use `direct_api_call` with endpoint `/api/v2/addresses/{address}/coin-balance-history-by-day` "
                "to get daily native coin balance history."
            ),
            (
                f"Use `direct_api_call` with endpoint `/api/v2/addresses/{address}/coin-balance-history` "
                "to get native coin balance history."
            ),
            (
                f"Use `direct_api_call` with endpoint `/api/v2/addresses/{address}/blocks-validated` "
                "to get Blocks Validated by this Address."
            ),
            (
                f"Use `direct_api_call` with endpoint `/api/v2/proxy/account-abstraction/accounts/{address}` "
                "to get Account Abstraction info."
            ),
            (
                f"Use `direct_api_call` with endpoint `/api/v2/proxy/account-abstraction/operations` "
                f"and query_params={{'sender': '{address}'}} to get User Operations sent by this Address."
            ),
        ]
    
        return build_tool_response(data=address_data, notes=notes, instructions=instructions)
  • Pydantic model defining the structure of the data returned by get_address_info, including basic_info from Blockscout and optional metadata.
    # --- Model for get_address_info Data Payload ---
    class AddressInfoData(BaseModel):
        """A structured representation of the combined address information."""
    
        basic_info: dict[str, Any] = Field(description="Core on-chain data for the address from the Blockscout API.")
        metadata: dict[str, Any] | None = Field(
            None,
            description="Optional metadata, such as public tags, from the Metadata service.",
        )
  • Registration of the get_address_info tool with the FastMCP server instance, including annotations and disabling structured output.
    mcp.tool(
        structured_output=False,
        annotations=create_tool_annotations("Get Address Information"),
    )(get_address_info)
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, and openWorldHint=true, covering safety and scope. The description adds valuable behavioral context beyond annotations by specifying what information is returned (e.g., 'Native token balance provided as is, without adjusting by decimals'), which helps the agent understand output format nuances that annotations don't capture.

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 with the core purpose, followed by a bulleted list of specific information returned, and ending with usage context. While efficient, the bulleted list format slightly reduces structural elegance compared to a purely prose approach.

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

Completeness4/5

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

Given the tool's complexity (comprehensive address analysis) and lack of output schema, the description does a good job explaining what information is returned through the detailed bullet points. However, it doesn't specify response format structure or potential limitations (e.g., rate limits, data freshness), leaving some gaps for the agent.

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 100%, with both parameters (chain_id, address) well-documented in the schema. The description doesn't add any parameter-specific semantics beyond what the schema already provides, maintaining the baseline score of 3 for high schema coverage.

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 with specific verbs ('Get comprehensive information about an address') and lists detailed resource types (address existence, token balance, ENS name, contract status, proxy info, token details). It distinguishes from siblings by focusing on comprehensive address analysis rather than specific operations like get_transactions_by_address or get_contract_abi.

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

Usage Guidelines4/5

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

The description provides clear context for when to use this tool ('Essential for address analysis, contract investigation, token research, and DeFi protocol analysis'), giving concrete use cases. However, it doesn't explicitly state when NOT to use it or name specific alternatives among the sibling tools for more targeted operations.

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