analyze_contract
Analyze Klever smart contract Rust source code for common issues. Checks for missing imports, missing #[klever_sc::contract] macro, missing endpoint annotations, payable handlers without call_value usage, storage mappers without #[storage_mapper], and missing event definitions. Returns findings with severity (error/warning/info) and links to relevant knowledge base entries.
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": {
"sourceCode": "<sourceCode>"
},
"name": "analyze_contract"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sourceCode | Yes | The full Rust source code of the Klever smart contract to analyze. Must be valid Rust code using klever_sc imports. | |
| contractName | No | Human-readable name for the contract (used in output labeling). Defaults to "contract" if omitted. |