get_blockchain_info
Retrieve Bitcoin blockchain details including chain status, difficulty, softfork information, chain work, and pruning data through the Bitcoin-MCP server.
Instructions
Get blockchain info: chain, difficulty, softfork statuses, chain work, pruning.
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:203-216 (handler)Implementation of the get_blockchain_info tool, which queries the Bitcoin RPC's getblockchaininfo method and formats the response.
@mcp.tool() def get_blockchain_info() -> str: """Get blockchain info: chain, difficulty, softfork statuses, chain work, pruning.""" info = get_rpc().getblockchaininfo() return json.dumps({ "chain": info["chain"], "blocks": info["blocks"], "headers": info["headers"], "difficulty": info["difficulty"], "verificationprogress": info["verificationprogress"], "size_on_disk": info["size_on_disk"], "pruned": info["pruned"], "softforks": info.get("softforks", {}), })