Skip to main content
Glama

read_contract

Retrieve data from smart contracts by calling view/pure functions without modifying blockchain state, gas fees, or signing. Supports 30+ Ethereum-compatible networks.

Instructions

Read data from a smart contract by calling a view/pure function. This doesn't modify blockchain state and doesn't require gas or signing.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
abiYesThe ABI (Application Binary Interface) of the smart contract function, as a JSON array
argsNoThe arguments to pass to the function, as an array (e.g., ['0x1234...'])
contractAddressYesThe address of the smart contract to interact with
functionNameYesThe name of the function to call on the contract (e.g., 'balanceOf')
networkNoNetwork name (e.g., 'ethereum', 'optimism', 'arbitrum', 'base', 'polygon') or chain ID. Defaults to Ethereum mainnet.
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key behavioral traits: that it's a read-only operation ('doesn't modify blockchain state'), has no cost implications ('doesn't require gas'), and has no authentication requirements ('doesn't require signing'). It doesn't mention rate limits or error handling, but covers the most critical aspects for a blockchain read operation.

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 perfectly concise with two sentences that each earn their place: the first states the core purpose, the second provides critical behavioral context. There's zero wasted language and it's front-loaded with the most important information.

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?

For a read-only contract interaction tool with no output schema, the description provides excellent context about what the tool does and its behavioral characteristics. It doesn't describe the return format or error cases, but given the 100% schema coverage and clear behavioral disclosure, it's nearly complete. The lack of output schema means some gaps remain in understanding what data will be returned.

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?

The schema description coverage is 100%, so all parameters are well-documented in the schema. The description doesn't add any parameter-specific information beyond what's already in the schema descriptions, which is acceptable given the comprehensive schema coverage. The baseline score of 3 reflects adequate but not enhanced parameter documentation.

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 the specific action ('Read data from a smart contract by calling a view/pure function') and resource ('smart contract'), distinguishing it from sibling tools like write_contract (which modifies state) and other query tools that don't involve contract function calls.

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

Usage Guidelines5/5

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

The description explicitly states when to use this tool ('This doesn't modify blockchain state and doesn't require gas or signing'), providing clear context for choosing it over alternatives like write_contract (which modifies state) or other tools that might require signing or gas.

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

Related 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/mcpdotdirect/evm-mcp-server'

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