Skip to main content
Glama

get_block_stats

Retrieve Bitcoin block statistics including median fees, transaction counts, total outputs, block weight, and subsidy by specifying the block height.

Instructions

Get raw block statistics: median fee, total output, subsidy, weight, tx count.

Args: height: Block height

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
heightYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function for the `get_block_stats` tool. It takes a block height as input, calls the `getblockstats` RPC method on the Bitcoin RPC interface, and returns the result as a JSON-encoded string.
    def get_block_stats(height: int) -> str:
        """Get raw block statistics: median fee, total output, subsidy, weight, tx count.
    
        Args:
            height: Block height
        """
        stats = get_rpc().getblockstats(height)
        return json.dumps(stats)

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