Query chaincode (evaluate, read-only)
query_chaincodeEvaluate a chaincode read function on Hyperledger Fabric and return its result. Use it for reads, never for state changes.
Instructions
Evaluate a chaincode read function on Hyperledger Fabric and return its result. Use for reads, never for state changes.
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": {
"channel": "<channel>",
"chaincode": "<chaincode>",
"method": "<method>"
},
"name": "query_chaincode"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| args | No | String args; JSON-encode objects | |
| method | Yes | Chaincode function, e.g. GetAsset | |
| channel | Yes | Fabric channel name | |
| contract | No | Contract name within chaincode (optional) | |
| chaincode | Yes | Chaincode name | |
| transientData | No | Private data, not recorded on the ledger |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes | Raw chaincode result, decoded as UTF-8 |