read_contract
Call view or pure functions on a smart contract to read on-chain data without gas, signing, or state changes. Provide contract address, ABI, function name, and optional arguments.
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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"contractAddress": "<contractAddress>",
"abi": "<abi>",
"functionName": "<functionName>"
},
"name": "read_contract"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| abi | Yes | The ABI (Application Binary Interface) of the smart contract function, as a JSON array | |
| args | No | The arguments to pass to the function, as an array (e.g., ['0x1234...']) | |
| functionName | Yes | The name of the function to call on the contract (e.g., 'balanceOf') | |
| contractAddress | Yes | The address of the smart contract to interact with |