net_getPeerCount
Retrieve the number of connected peers on Ethereum networks to monitor network connectivity and health.
Instructions
Returns the number of peers currently connected to the client. Useful for monitoring network connectivity and health.
Args:
network (string, optional): Ethereum network to query, defaults to 'mainnet'
Returns:
Hex-encoded integer representing the number of connected peers (e.g., '0x19' for 25 peers)
Examples:
"Get mainnet peer count": {}
"Get Sepolia peer count": { "network": "sepolia" }
Errors:
InternalError: When Infura API is unavailable
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| network | No | The Ethereum network to query, e.g., 'mainnet' or 'sepolia'. | mainnet |
| response_format | No | Output format: 'json' for structured data, 'markdown' for human-readable. | json |