Skip to main content
Glama

get_situation_summary

Get a quick Bitcoin briefing with current price, fees, mempool status, and chain tip in one call to understand market conditions.

Instructions

Get a quick Bitcoin briefing: price, fees, mempool, and chain tip in one call. Use this as your first call to understand current conditions — replaces calling 5+ tools separately.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The tool `get_situation_summary` provides a quick Bitcoin briefing by aggregating data from various Bitcoin RPC methods and an external price API.
    @mcp.tool()
    def get_situation_summary() -> str:
        """Get a quick Bitcoin briefing: price, fees, mempool, and chain tip in one call. Use this as your first call to understand current conditions — replaces calling 5+ tools separately."""
        try:
            rpc = get_rpc()
    
            fees = rpc.estimatesmartfee(1)
            fees_6 = rpc.estimatesmartfee(6)
            fees_144 = rpc.estimatesmartfee(144)
            mempool = rpc.getmempoolinfo()
            blockchain = rpc.getblockchaininfo()
    
            next_block_rate = round(fees.get("feerate", 0) * 100000, 2)
            hour_rate = round(fees_6.get("feerate", 0) * 100000, 2)
            day_rate = round(fees_144.get("feerate", 0) * 100000, 2)
    
            # Fetch BTC price
            btc_usd = None
            try:
                url = "https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=usd&include_24hr_change=true"
                req = urllib.request.Request(url, headers={"User-Agent": "bitcoin-mcp"})
                with urllib.request.urlopen(req, timeout=5) as resp:
                    price_data = json.loads(resp.read(1_000_000))
                btc = price_data.get("bitcoin", {})
                btc_usd = btc.get("usd")
                btc_24h_change = round(btc.get("usd_24h_change", 0), 2)
            except Exception:
                btc_24h_change = None
    
            # Typical tx cost in USD (140 vB native segwit)
            typical_cost_sats = round(next_block_rate * 140)
            typical_cost_usd = round((typical_cost_sats / 1e8) * btc_usd, 2) if btc_usd else None
    
            summary = {
                "btc_usd": btc_usd,
                "btc_24h_change_pct": btc_24h_change,
                "height": blockchain.get("blocks"),
                "chain": blockchain.get("chain"),
                "sync_progress_pct": round(blockchain.get("verificationprogress", 0) * 100, 2),
                "fees_sat_per_vb": {
                    "next_block": next_block_rate,
                    "hour": hour_rate,
                    "day": day_rate,
                },
                "typical_tx_cost": {
                    "sats": typical_cost_sats,
                    "usd": typical_cost_usd,
                },
                "mempool": {
                    "tx_count": mempool.get("size", 0),
                    "size_mb": round(mempool.get("bytes", 0) / 1_000_000, 2),
                    "min_fee_sat_vb": round(mempool.get("mempoolminfee", 0) * 100000, 2),
                },
            }
            return json.dumps(summary)
        except Exception as e:
            hint = _connection_hint(e)
            return json.dumps({"error": str(e), "hint": hint})

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/Bortlesboat/bitcoin-mcp'

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