Read Contract
read_contractCall any view/pure function on a smart contract and return the decoded result, using a supplied ABI fragment. Supports historical reads via block_identifier and caller_address context for msg.sender-dependent views. Read-only: state-changing functions are rejected.
Use when: Use when a protocol question needs a contract read that no higher-level tool covers — e.g. a niche view function or a protocol outside the standard tool set. Prefer purpose-built tools (get_defi_positions, get_lending_rates) for supported protocols.
Limitations: Requires a valid ABI fragment; payable/nonpayable functions are rejected. Ethereum mainnet and Base only, with bounded RPC timeout and retry.
Alternatives: get_defi_positions, get_lending_rates, get_token_approvals
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| args | No | DEPRECATED: Positional arguments for the function call. Use 'args_json' for complex objects or Gemini compatibility. | |
| chain_id | No | Chain ID (1=Ethereum, 8453=Base) | |
| args_json | No | Optional 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_fragment | Yes | JSON 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_name | Yes | Name of the function to call | |
| caller_address | No | Optional EVM address to supply as msg.sender for caller-dependent view functions. This does not sign or submit a transaction. | |
| block_identifier | No | Block number, block hash, or 'latest'/'earliest'/'pending' | latest |
| contract_address | Yes | Contract address (0x…) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes | ||
| chain_id | Yes | ||
| function_name | Yes | ||
| caller_address | No | ||
| block_identifier | Yes | ||
| contract_address | Yes |