net_getVersion
Get the current Ethereum network ID to confirm whether you are on mainnet, Sepolia, or another network.
Instructions
Returns the current network ID. Useful for identifying which Ethereum network the node is connected to (1=mainnet, 11155111=sepolia, etc.).
Args:
network (string, optional): Ethereum network to query, defaults to 'mainnet'
Returns:
String representing the network ID (e.g., '1' for mainnet, '11155111' for Sepolia)
Examples:
"Get mainnet network ID": {}
"Verify Sepolia network ID": { "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 |