Skip to main content
Glama

analyze_next_block

Predict Bitcoin's next block details including transactions, weight utilization, miner revenue, fee percentiles, and top-fee transactions for blockchain analysis.

Instructions

Predict next block: transactions, weight utilization, miner revenue, fee percentiles, top-fee txs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Tool registration and handler for `analyze_next_block`. It delegates to `_analyze_next_block` (imported from `bitcoinlib_rpc.nextblock`) and formats the output for JSON.
    @mcp.tool()
    def analyze_next_block() -> str:
        """Predict next block: transactions, weight utilization, miner revenue, fee percentiles, top-fee txs."""
        data = _analyze_next_block(get_rpc())
        # Convert tuples to lists for JSON serialization
        if "top_5" in data:
            data["top_5"] = [
                {"txid": txid, "fee_rate": rate, "fee_sats": fee}
                for txid, rate, fee in data["top_5"]
            ]
        return json.dumps(data)

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