Skip to main content
Glama

net_peerCount

Check how many peers are currently connected to your EVM client to monitor network connectivity and node status across Ethereum, Polygon, Arbitrum, and other compatible chains.

Instructions

Returns number of peers currently connected to the client

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • src/index.ts:911-945 (registration)
    Registration of the net_peerCount tool including its handler function. The handler calls the Ethereum JSON-RPC method net_peerCount via the makeRPCCall helper, parses the hexadecimal result to decimal, formats it using formatResponse, and returns structured content or error message.
    server.tool( "net_peerCount", "Returns number of peers currently connected to the client", {}, async () => { try { const result = await makeRPCCall("net_peerCount"); const peerCount = parseInt(result, 16); return { content: [ { type: "text", text: formatResponse( { peer_count_hex: result, peer_count_decimal: peerCount, }, "Connected Peers", ), }, ], }; } catch (error: any) { return { content: [ { type: "text", text: `Error: ${error.message}`, }, ], }; } }, );

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/JamesANZ/evm-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server