Skip to main content
Glama

Read Contract

read_contract
Read-only

Call any view/pure function on a smart contract and return the result. Provide the ABI fragment (JSON array) and function name. State-changing functions (payable/nonpayable) are rejected for safety. Supports historical queries via block_identifier (block number or 'latest') and optional caller_address context for msg.sender-dependent views. Calls use Teardrop's bounded RPC timeout and rate-limit retry policy.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
argsNoDEPRECATED: Positional arguments for the function call. Use 'args_json' for complex objects or Gemini compatibility.
chain_idNoChain ID (1=Ethereum, 8453=Base)
args_jsonNoOptional JSON array string of positional arguments for the function call. Use this instead of 'args' for complex types or when calling via Google/Gemini.
abi_fragmentYesJSON array containing the ABI for the function to call. Supports both modern (stateMutability: view/pure) and legacy (constant: true) formats. Only read-only functions are allowed.
function_nameYesName of the function to call
caller_addressNoOptional EVM address to supply as msg.sender for caller-dependent view functions. This does not sign or submit a transaction.
block_identifierNoBlock number, block hash, or 'latest'/'earliest'/'pending'latest
contract_addressYesContract address (0x…)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
chain_idYes
function_nameYes
caller_addressNo
block_identifierYes
contract_addressYes

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed10 schema fields changed
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / abi_fragment / title
      Added value: +"Abi Fragment"
    • addedInput schema / properties / args / title
      Added value: +"Args"
    • addedInput schema / properties / args_json / title
      Added value: +"Args Json"
    • addedInput schema / properties / block_identifier / title
      Added value: +"Block Identifier"
    • addedInput schema / properties / caller_address / title
      Added value: +"Caller Address"
    • addedInput schema / properties / chain_id / title
      Added value: +"Chain Id"
    • addedInput schema / properties / contract_address / title
      Added value: +"Contract Address"
    • addedInput schema / properties / function_name / title
      Added value: +"Function Name"
    • addedInput schema / title
      Added value: +"mcp_read_contractArguments"
  2. Changed2 schema fields changed
    • addedInput schema / properties / caller_address
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Optional EVM address to supply as msg.sender for caller-dependent view functions. This does not sign or submit a transaction."
      +}
    • addedOutput schema / properties / caller_address
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Caller Address"
      +}
  3. First observed

TDQS

A4.3/5.0
Behavior5/5

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

Beyond the readOnlyHint annotation, the description discloses that state-changing functions are rejected, that historical queries are supported, and that calls use a bounded RPC timeout and rate-limit retry policy. This adds meaningful behavioral context about safety and reliability that is not available from annotations alone.

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 concise at five sentences, front-loaded with the core purpose. Each sentence adds value, covering safety, historical queries, caller context, and RPC policy. It is slightly longer than necessary but remains efficient and well-structured.

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 tool's complexity (8 parameters, output schema, readOnlyHint), the description covers key functional aspects: arbitrary view/pure calls, ABI requirements, rejection of state-changing functions, historical block support, caller context, and timeout/retry behavior. It does not explain return formatting, but the output schema covers this, and not all parameter semantics are repeated, which is acceptable.

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 descriptions cover 100% of parameters, so the description adds little extra information. It mentions providing the ABI fragment and block_identifier, but these are already well-documented in the schema. The description does not clarify ambiguous parameters like args vs args_json, so it remains at the baseline for high schema coverage.

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 tool calls any view/pure function on a smart contract and returns the result. It specifically distinguishes itself by noting state-changing functions are rejected, making it distinct from sibling tools that perform specific reads or transactions.

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 clear context by stating it is for view/pure functions, explicitly excluding state-changing functions for safety. It also mentions support for historical queries and caller_address, which guides when to use these features. However, it does not explicitly mention when to prefer sibling tools like get_erc20_balance for specific token reads.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

TDQS

A3.7/5.0
Disambiguation3/5

Most tools target distinct data sources, but several near-duplicates exist: get_token_approvals/get_wallet_approvals, get_defi_positions/get_wallet_positions, and get_wallet_portfolio/get_eth_balance. The descriptions do cross-reference and clarify the differences, so an agent can disambiguate with effort, but names alone are not enough.

Naming Consistency4/5

The dominant get_<noun> pattern is clear and nearly all names use lowercase snake_case with verb-first conventions. A few tools like calculate, record_predictions, http_fetch, and web_search break the get_ pattern, but the overall style remains predictable.

Tool Count2/5

34 tools is excessive for a single server, even for a broad DeFi/onchain analytics domain. The count is inflated by generic utilities such as calculate, count_text_stats, web_search, and http_fetch, plus multiple overlapping data-retrieval endpoints, making the surface hard to scan.

Completeness4/5

The set covers an unusually wide range of domain operations: prices, balances, portfolio/positions, approvals, yields, TVL, DEX quotes/volume, transactions, blocks, gas, ENS, contract reads, and risk assessments. It is view-only by design, so missing write/transaction tools is acceptable; minor gaps like address-based token pricing or transaction simulation are workaround-able.

Resources