eth_chainId
Retrieve the chain ID for any Ethereum network to enable EIP-155 compliant transaction signatures. Specify a network like 'mainnet' or 'sepolia' to get the hexadecimal chain ID.
Instructions
Get the chain ID of an Ethereum network for EIP-155 transaction signing.
Args:
network (string, optional): Ethereum network to query. Defaults to 'mainnet'.
Returns:
Hexadecimal string representing the chain ID (e.g., '0x1' for mainnet, '0xaa36a7' for Sepolia).
Examples:
"Get mainnet chain ID": {}
"Get Sepolia chain ID": { "network": "sepolia" }
Errors:
InternalError: When Infura API is unavailable or returns an error.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "eth_chainId"
}
}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 |