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
| Name | Required | Description | Default |
|---|---|---|---|
| height | Yes |
Output Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/bitcoin_mcp/server.py:231-238 (handler)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)