validate_stylus_code
Validate Stylus Rust code for smart contracts by running cargo check to detect compilation errors and provide structured fixes with line numbers and guidance.
Instructions
Compile-check Stylus Rust code via cargo check and return structured errors with Stylus-specific fix guidance. Use AFTER generating code to verify correctness. Returns error codes, line numbers, and suggested fixes. Requires Docker.
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": {
"code": "<code>"
},
"name": "validate_stylus_code"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | lib.rs source code to validate | |
| cargo_toml | No | Cargo.toml content (uses default SDK 0.10.0 template if omitted) |