get_network_info
Retrieve Bitcoin network details including protocol version, connection status, relay fees, and warnings to monitor blockchain health and API server network view.
Instructions
Get network info: protocol version, relay fee, connections, warnings. In hosted API mode, reflects the API server's network view.
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:182-196 (handler)The `get_network_info` tool implementation in `src/bitcoin_mcp/server.py`. It calls the RPC `getnetworkinfo` method and formats the result.
@mcp.tool() def get_network_info() -> str: """Get network info: protocol version, relay fee, connections, warnings. In hosted API mode, reflects the API server's network view.""" info = get_rpc().getnetworkinfo() return json.dumps({ "version": info["version"], "subversion": info["subversion"], "protocolversion": info["protocolversion"], "connections": info["connections"], "connections_in": info.get("connections_in", 0), "connections_out": info.get("connections_out", 0), "relayfee": info["relayfee"], "warnings": info.get("warnings", ""), })