Read from Contract
read_contract Calls a smart contract function (view/pure, or non-view/pure simulated via eth_call) and returns the
decoded result.
This tool provides a direct way to query the state of a smart contract.
Example:
To check the USDT balance of an address on Ethereum Mainnet, you would use the following arguments:
{
"tool_name": "read_contract",
"params": {
"chain_id": "1",
"address": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
"abi": {
"constant": true,
"inputs": [{"name": "_owner", "type": "address"}],
"name": "balanceOf",
"outputs": [{"name": "balance", "type": "uint256"}],
"payable": false,
"stateMutability": "view",
"type": "function"
},
"function_name": "balanceOf",
"args": "["0xF977814e90dA44bFA03b6295A0616a897441aceC"]"
}
}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| abi | Yes | The JSON ABI for the specific function being called. This should be a dictionary that defines the function's name, inputs, and outputs. The function ABI can be obtained using the `get_contract_abi` tool. | |
| args | No | A JSON string containing an array of arguments. Example: "["0xabc..."]" for a single address argument, or "[]" for no arguments. Order and types must match ABI inputs. Addresses: use 0x-prefixed strings; Numbers: prefer integers (not quoted); numeric strings like "1" are also accepted and coerced to integers. Bytes: keep as 0x-hex strings. | [] |
| block | No | The block identifier to read the contract state from. Can be a block number (e.g., 19000000) or a string tag (e.g., 'latest'). Defaults to 'latest'. | latest |
| address | Yes | Smart contract address | |
| chain_id | Yes | The ID of the blockchain | |
| session_id | No | Opaque session identifier. | |
| function_name | Yes | The symbolic name of the function to be called. This must match the `name` field in the provided ABI. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | The main data payload of the tool's response. | |
| notes | No | A list of important contextual notes, such as warnings about data truncation or data quality issues. | |
| pagination | No | Pagination information, present only if the 'data' is a single page of a larger result set. | |
| content_text | No | Optional human-readable summary used for MCP content responses. | |
| instructions | No | A list of suggested follow-up actions or instructions for the LLM to plan its next steps. | |
| data_description | No | A list of notes explaining the structure, fields, or conventions of the 'data' payload. |