Verify blockchain chain ID via public RPC
The agent confirms the active blockchain network by comparing the RPC response against the official chain ID, ensuring correct connectivity without requiring API credentials.
How it works
The agent first retrieves the list of supported chains using the public endpoint to identify valid chains. It selects a target chain and uses the MCP server's documentation tools to find the correct method info for eth_chainId. It then executes the eth_chainId RPC call via the public endpoint. Finally, it compares the returned chain ID with the known official ID for that chain. If they match, it reports success; if not, it stops and reports the discrepancy to prevent acting on the wrong network.
Prompt
Paste this into an agent that has the servers below connected. Adjust the names and dates to your own.
List the supported chains and choose one whose public methods allow eth_chainId. Use get_method_info for that chain and method, then call eth_chainId with rpc_call without an API key. Compare the returned ID numerically with the selected chain's published chain_id and report the result and applicable public limits. If the ID is missing, invalid or different, stop and report it instead of claiming success.MCP servers it needs
Source
The vendor page this playbook is drawn from, and the passage that supports it.
List the supported chains and choose one whose public methods allow eth_chainId. Use get_method_info for that chain and method, then call eth_chainId with rpc_call without an API key.BlockVectra MCP documentation