Call contract function (read-only)
call_contract_functionExecute read-only smart contract calls on Celo using eth_call to retrieve function results without signing or sending transactions. Failed calls return success false with the revert reason.
Instructions
Call a contract function with eth_call and return its result. Read-only: nothing is signed or sent, even for functions that would change state. Integers larger than 2^53 are returned as decimal strings and bytes as 0x-prefixed hex. A failed call returns success false with the revert reason in error.
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": {
"contract_address": "<contract_address>",
"function_name": "<function_name>",
"abi": "<abi>"
},
"name": "call_contract_function"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| abi | Yes | The contract ABI, as a JSON array or a JSON string. Only the entry for function_name is needed. | |
| from_address | No | Address to call from (msg.sender). | |
| function_args | No | Positional arguments for the function. | |
| function_name | Yes | The function to call, as named in the ABI. | |
| contract_address | Yes | The contract address. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | Error message if failed | |
| result | No | Function call result | |
| success | Yes | Whether call was successful | |
| function_name | Yes | Function name | |
| contract_address | Yes | Contract address |