get_exit_queue
Retrieve real-time Ethereum validator exit queue data, including queue length, active validators, total ETH balance, and estimated wait time for informed staking decisions.
Instructions
Get current Ethereum validator exit queue statistics.
Returns:
A string containing:
- Current exit queue length (number of validators waiting to exit)
- Total active validators
- Total balance of exiting validators in ETH
- Estimated wait time (based on ~900 exits per day)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- main.py:40-67 (handler)The handler function implementing the 'get_exit_queue' tool logic. It fetches Ethereum validator exit queue statistics from the beaconcha.in API, processes the data, and returns a formatted string with queue length, active validators, exiting balance, and estimated wait time. Registered via the @mcp.tool() decorator.@mcp.tool() async def get_exit_queue() -> str: """Get current Ethereum validator exit queue statistics. Returns: A string containing: - Current exit queue length (number of validators waiting to exit) - Total active validators - Total balance of exiting validators in ETH - Estimated wait time (based on ~900 exits 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"] exiting = data.get("beaconchain_exiting", 0) validators_count = data.get("validatorscount", 0) exiting_balance = data.get("beaconchain_exiting_balance", 0) / 1e9 if data.get("beaconchain_exiting_balance") else 0 return ( f"Current exit queue length: {exiting} validators\n" f"Total active validators: {validators_count}\n" f"Exiting validators balance: {exiting_balance:.2f} ETH\n" f"Estimated wait time: Approximately {exiting / 900:.1f} days " f"(assuming ~900 exits per day)" ) except Exception as e: return f"Error fetching exit queue data: {str(e)}"