get_activation_queue
Retrieve real-time Ethereum validator activation queue statistics including queue length, active validators, total balance entering, and estimated wait time to monitor staking dynamics.
Instructions
Get current Ethereum validator activation queue statistics.
Returns:
A string containing:
- Current activation queue length (number of validators waiting to activate)
- Total active validators
- Total balance of entering validators in ETH
- Estimated wait time (based on ~900 activations per day)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- main.py:11-37 (handler)The handler function that fetches Ethereum validator activation queue data from the beaconcha.in API, processes it, and returns formatted statistics including queue length, active validators, entering balance, and estimated wait time.async def get_activation_queue() -> str: """Get current Ethereum validator activation queue statistics. Returns: A string containing: - Current activation queue length (number of validators waiting to activate) - Total active validators - Total balance of entering validators in ETH - Estimated wait time (based on ~900 activations per day) """ async with httpx.AsyncClient() as client: try: response = await client.get("https://beaconcha.in/api/v1/validators/queue") response.raise_for_status() data = response.json()["data"] entering = data.get("beaconchain_entering", 0) validators_count = data.get("validatorscount", 0) entering_balance = data.get("beaconchain_entering_balance", 0) / 1e9 if data.get("beaconchain_entering_balance") else 0 return ( f"Current activation queue length: {entering} validators\n" f"Total active validators: {validators_count}\n" f"Entering validators balance: {entering_balance:.2f} ETH\n" f"Estimated wait time: Approximately {entering / 900:.1f} days " f"(assuming ~900 activations per day)" ) except Exception as e: return f"Error fetching activation queue data: {str(e)}"
- main.py:10-10 (registration)The @mcp.tool() decorator registers the get_activation_queue function as an MCP tool.@mcp.tool()
- main.py:12-20 (schema)Docstring defining the tool's purpose and output format, serving as the schema for the tool."""Get current Ethereum validator activation queue statistics. Returns: A string containing: - Current activation queue length (number of validators waiting to activate) - Total active validators - Total balance of entering validators in ETH - Estimated wait time (based on ~900 activations per day) """