Skip to main content
Glama
kukapay

ethereum-validator-queue-mcp

get_validator_status

Retrieve real-time status, balance, and activation/exit details for any Ethereum validator using its public key to monitor staking participation.

Instructions

Get status for a specific Ethereum validator by public key.

Args:
    pubkey (str): The public key of the validator (48-byte hex string starting with '0x')

Returns:
    A string containing:
    - Validator public key
    - Current status (e.g., active_online, pending, exited)
    - Effective balance in ETH
    - Activation epoch (if applicable)
    - Exit epoch (if applicable)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pubkeyYes

Implementation Reference

  • main.py:70-100 (handler)
    The handler function for the 'get_validator_status' tool. It takes a validator public key, fetches status data from the beaconcha.in API, and returns formatted status information including status, balance, activation and exit epochs.
    @mcp.tool()
    async def get_validator_status(pubkey: str) -> str:
        """Get status for a specific Ethereum validator by public key.
        
        Args:
            pubkey (str): The public key of the validator (48-byte hex string starting with '0x')
        
        Returns:
            A string containing:
            - Validator public key
            - Current status (e.g., active_online, pending, exited)
            - Effective balance in ETH
            - Activation epoch (if applicable)
            - Exit epoch (if applicable)
        """
        async with httpx.AsyncClient() as client:
            try:
                response = await client.get(f"https://beaconcha.in/api/v1/validator/{pubkey}")
                response.raise_for_status()
                data = response.json()["data"]
                status = data.get("status", "unknown")
                balance = data.get("balance", 0) / 1e9 if data.get("balance") else 0
                return (
                    f"Validator {pubkey}:\n"
                    f"Status: {status}\n"
                    f"Effective Balance: {balance:.2f} ETH\n"
                    f"Activation Epoch: {data.get('activationepoch', 'N/A')}\n"
                    f"Exit Epoch: {data.get('exitepoch', 'N/A')}"
                )
            except Exception as e:
                return f"Error fetching validator status: {str(e)}"
  • main.py:70-70 (registration)
    The @mcp.tool() decorator registers the get_validator_status function as an MCP tool.
    @mcp.tool()
  • main.py:72-84 (schema)
    Docstring provides input schema (pubkey: str) and output description for the tool.
    """Get status for a specific Ethereum validator by public key.
    
    Args:
        pubkey (str): The public key of the validator (48-byte hex string starting with '0x')
    
    Returns:
        A string containing:
        - Validator public key
        - Current status (e.g., active_online, pending, exited)
        - Effective balance in ETH
        - Activation epoch (if applicable)
        - Exit epoch (if applicable)
    """

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/kukapay/ethereum-validator-queue-mcp'

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