Skip to main content
Glama

eth_getTransactionCount

Retrieve the transaction count (nonce) for an Ethereum address to determine the next nonce for sending transactions.

Instructions

Returns the number of transactions sent from an address (nonce). Useful for determining the next nonce for sending transactions.

Args:

  • address (string): 20-byte Ethereum address in hex format (e.g., '0x742d35Cc6634C0532925a3b844Bc9e7595f...')

  • tag (string, optional): Block tag - 'latest', 'earliest', or 'pending', defaults to 'latest'

  • network (string, optional): Ethereum network to query, defaults to 'mainnet'

Returns:

  • Hex-encoded integer representing the number of transactions sent from the address

Examples:

  • "Get current nonce for address": { "address": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e" }

  • "Get pending transaction count": { "address": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e", "tag": "pending" }

Errors:

  • InvalidParams: When address format is invalid or tag is not a valid block tag

  • InternalError: When Infura API is unavailable

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYesThe Ethereum address to query.
tagNoThe block tag to use for the query.
networkNoThe Ethereum network to query, e.g., 'mainnet' or 'sepolia'.mainnet
response_formatNoOutput format: 'json' for structured data, 'markdown' for human-readable.json
Behavior4/5

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

No annotations are provided, so the description must fully disclose behavior. It details the return value (hex-encoded integer), lists possible errors, and implies a read-only operation. Additional context like rate limits or authentication is absent but not critical for this simple query.

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 well-structured with clear sections (Args, Returns, Examples, Errors). It is concise with no redundant information, and each part serves a clear purpose.

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 no output schema, the description adequately explains the return format and error conditions. It covers three of four parameters in detail. The missing response_format parameter is a minor gap, but overall completeness is high for this tool's simplicity.

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

Parameters3/5

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

Schema coverage is 100%, so baseline is 3. The description adds value for address, tag, and network parameters with explanations and examples, but misses the response_format parameter present in the schema. The added examples and defaults justify a score of 3.

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 states it returns the number of transactions from an address (nonce) and explains its use for next nonce determination. This is distinct from sibling tools like eth_getBalance or eth_getBlockByNumber, 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 states the tool is for getting nonce values. While it doesn't explicitly say when not to use it, the context of sibling tools and the clear purpose make usage guidance adequate.

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