Skip to main content
Glama

get_peer_info

Retrieve connected peer details including addresses, latency, services, and version information from the Bitcoin network via the Bitcoin-MCP server.

Instructions

Get connected peer details: addresses, latency, services, version. In hosted API mode, shows the API server's peers.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Tool handler for 'get_peer_info' that queries the RPC client's getpeerinfo method and formats the output.
    @mcp.tool()
    def get_peer_info() -> str:
        """Get connected peer details: addresses, latency, services, version. In hosted API mode, shows the API server's peers."""
        peers = get_rpc().getpeerinfo()
        summary = []
        for p in peers[:20]:  # limit to 20
            summary.append({
                "addr": p.get("addr"),
                "subver": p.get("subver"),
                "pingtime": p.get("pingtime"),
                "synced_blocks": p.get("synced_blocks"),
                "connection_type": p.get("connection_type"),
            })
        return json.dumps(summary)

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