midl_write_contract
Execute a state-changing function on a smart contract using the MIDL intention flow. Supports payable functions with value parameter in wei.
Instructions
Execute a state-changing function on a smart contract via MIDL intention flow. For payable functions, include value parameter (in wei).
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": {
"address": "<address>",
"abi": "<abi>",
"functionName": "<functionName>"
},
"name": "midl_write_contract"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| address | Yes | Contract address | |
| abi | Yes | Contract ABI (JSON array) | |
| functionName | Yes | Function name to call | |
| args | No | Function arguments | |
| value | No | BTC value to send (in wei) for payable functions |