Skip to main content
Glama

eth_call

Execute read-only smart contract calls to retrieve on-chain data without sending transactions.

Instructions

Execute a read-only smart contract call without creating a transaction.

Args:

  • to (string): Contract address to call (20-byte hex, e.g., '0x...').

  • data (string): ABI-encoded function call data (hex string starting with 0x).

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

Returns:

  • Hexadecimal string containing the return value of the executed contract method.

Examples:

  • "Read ERC20 balance": { "to": "0xdAC17F958D2ee523a2206206994597C13D831ec7", "data": "0x70a08231000000000000000000000000..." }

  • "Query on Sepolia": { "to": "0x...", "data": "0x...", "network": "sepolia" }

Errors:

  • InvalidParams: When 'to' address or 'data' format is invalid.

  • InternalError: When contract execution reverts or Infura API fails.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toYesThe address of the contract to call.
dataYesThe data to send with the call.
networkNoThe Ethereum network to query, e.g., 'mainnet' or 'sepolia'.mainnet
response_formatNoOutput format: 'json' for structured data, 'markdown' for human-readable.json
Behavior3/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 states it is read-only and lists errors (InvalidParams, InternalError), but does not mention that the call is a simulation (no gas cost), that the contract must have code, or that the data must be ABI-encoded. While examples help, more behavioral details would improve transparency.

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

Conciseness4/5

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

The description is well-structured with bullet points for args, returns, errors, and examples. It is fairly concise at about 10 lines, but could be slightly trimmed (e.g., remove some redundancy). The key information is front-loaded in the first sentence.

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 there is no output schema, the description adequately explains the return value (hexadecimal string) and errors. It covers the main parameters and provides examples. However, it misses the 'response_format' parameter (documented only in schema) and could mention that the call simulates execution on the specified network state. Overall, it is fairly complete for a tool with 4 parameters.

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 description coverage is 100%, so each parameter is documented in the schema. The description elaborates on 'to', 'data', and 'network' with formats and defaults, adding value beyond schema. However, the 'response_format' parameter (present in schema) is not mentioned in the description, leaving a gap. The examples add clarity for 'to' and 'data'.

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 'Execute a read-only smart contract call without creating a transaction,' which specifies the verb (execute), resource (smart contract call), and read-only nature. This clearly distinguishes it from sibling tools like eth_getBalance or eth_sendTransaction (not listed but implied), making the purpose unambiguous.

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 gives when to use (read-only calls without creating a transaction) and includes examples and error conditions. However, it does not explicitly mention when not to use or compare with alternatives among the many sibling tools (e.g., eth_call vs. eth_estimateGas for gas estimation). The guidance is clear but lacks explicit exclusions.

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