read_contract
Query smart contract functions directly to retrieve decoded state data. Use the tool by specifying chain ID, contract address, ABI, and function name to obtain specific contract information programmatically.
Instructions
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. | |
address | Yes | Smart contract address | |
args | No | A JSON array of arguments (not a string). Example: ["0xabc..."] is correct; "[\"0xabc...\"]" is incorrect. Order and types must match ABI inputs. Addresses: use 0x-prefixed strings; Numbers: use integers (not quoted); Bytes: keep as 0x-hex strings. If no arguments, pass [] or omit this field. | |
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 |
chain_id | Yes | The ID of the blockchain | |
function_name | Yes | The symbolic name of the function to be called. This must match the `name` field in the provided ABI. |