Skip to main content
Glama

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
networkNoThe Ethereum network to query, e.g., 'mainnet' or 'sepolia'.mainnet
response_formatNoOutput format: 'json' for structured data, 'markdown' for human-readable.json
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description fully carries the burden. It discloses the operation (read-only query), return type (hex string), and errors (Infura API unavailability), ensuring transparency about behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise, well-organized with sections (Args, Returns, Examples, Errors), and front-loads the purpose. Every sentence serves a clear role.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the simplicity of the tool (2 parameters, no output schema), the description covers purpose, major parameters, returns, examples, and errors. It lacks detail on 'response_format' but the schema covers it, making it adequately complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 100% coverage, so baseline is 3. The description adds value by explaining the 'network' parameter with default and examples, but does not mention 'response_format', which is only in the schema. Overall meaningful addition.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly specifies the tool retrieves the chain ID for EIP-155 signing. It distinguishes from sibling tools like eth_call or eth_getBalance, which serve different purposes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides examples and context for EIP-155, yet it does not explicitly state when not to use this tool or mention alternatives. However, the uniqueness of the function among siblings makes usage clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/Qbandev/infura-mcp-server'

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