get_supply_info
Retrieve Bitcoin supply metrics including circulating supply, max supply, inflation rate, block subsidy, and next halving estimate for analysis.
Instructions
Get Bitcoin supply data: circulating supply, max supply, inflation rate, subsidy per block, and next halving estimate.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/bitcoin_mcp/server.py:959-1002 (handler)The get_supply_info tool handler implemented in src/bitcoin_mcp/server.py. It fetches blockchain info and calculates supply statistics.
def get_supply_info() -> str: """Get Bitcoin supply data: circulating supply, max supply, inflation rate, subsidy per block, and next halving estimate.""" try: rpc = get_rpc() info = rpc.getblockchaininfo() height = info["blocks"] # Calculate current subsidy halvings = height // 210_000 subsidy_btc = 50.0 / (2 ** halvings) # Supply calculation (approximate from subsidy schedule) total_mined = 0.0 for h in range(halvings): total_mined += 210_000 * (50.0 / (2 ** h)) blocks_in_current_era = height - (halvings * 210_000) total_mined += blocks_in_current_era * subsidy_btc # Next halving next_halving_height = (halvings + 1) * 210_000 blocks_until_halving = next_halving_height - height est_days_until_halving = round(blocks_until_halving * 10 / 60 / 24) # Annual inflation rate blocks_per_year = 365.25 * 24 * 6 # ~52,560 annual_new_btc = blocks_per_year * subsidy_btc inflation_rate_pct = round((annual_new_btc / total_mined) * 100, 3) if total_mined > 0 else 0 return json.dumps({ "circulating_supply_btc": round(total_mined, 8), "max_supply_btc": 21_000_000, "pct_mined": round((total_mined / 21_000_000) * 100, 2), "current_subsidy_btc": subsidy_btc, "halvings_completed": halvings, "current_height": height, "next_halving_height": next_halving_height, "blocks_until_halving": blocks_until_halving, "est_days_until_halving": est_days_until_halving, "annual_inflation_rate_pct": inflation_rate_pct, }) except Exception as e: hint = _connection_hint(e) return json.dumps({"error": str(e), "hint": hint})