get_exit_queue
Retrieve current Ethereum validator exit queue statistics including queue length, active validators, total exiting balance, and estimated wait time to monitor staking dynamics.
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 for the 'get_exit_queue' tool. It fetches Ethereum validator exit queue statistics from the beaconcha.in API, including queue length, active validators, exiting balance, and estimated wait time. Decorated with @mcp.tool() for registration.@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)}"