write_contract
Interact with smart contracts on BNB Chain by calling state-changing functions. Specify contract address, ABI, function name, arguments, and network to execute write operations securely.
Instructions
Write data to a smart contract by calling a state-changing function
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>",
"args": "<args>"
},
"name": "write_contract"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| abi | Yes | The ABI of the smart contract function, as a JSON array | |
| args | Yes | The arguments to pass to the function | |
| contractAddress | Yes | The address of the smart contract to interact with | |
| functionName | Yes | The name of the function to call on the contract | |
| network | No | Network name (e.g. 'bsc', 'opbnb', 'ethereum', 'base', etc.) or chain ID. Supports others main popular networks. Defaults to BSC mainnet. | bsc |
| privateKey | No | Private key of the sending account. Used only for transaction signing. | 0x5a2b7e4d9c8f1a3e6b0d2c5f4e3d2a1b0c9f8e7d6a5b4c3d2e1f0a9b8c7d6e5f4 |