query_contract
Call registered smart contract functions on the Qubic network with automatic encoding and decoding. Provide contract name, function name, and input parameters to get human-readable results.
Instructions
Query a registered smart contract function with automatic binary encoding/decoding.
Use register_contract first to define the contract's functions and their field schemas. Then call this tool by contract name and function name.
Input values are provided as a JSON object with field names as keys. For example: {"gateId": 1}
The response is automatically decoded into human-readable named fields.
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": "<contract>",
"function": "<function>"
},
"name": "query_contract"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | No | JSON object of named input parameters (e.g., {"gateId": 1}). Omit for functions with no input. | |
| contract | Yes | Name of the registered contract | |
| function | Yes | Name of the function to call |