validate_openscad_code
Validates OpenSCAD code without generating geometry, returning structured errors and warnings with line numbers so you can fix issues before model generation.
Instructions
Validate OpenSCAD code without generating geometry.
Compiles the code and returns structured error/warning information
with line numbers. Use this to check code before calling
generate_model with OpenSCAD.
:param scad_code: OpenSCAD source code to validate — the same parameter
name ``compile_scad`` / ``analyze_scad_code`` / ``tweak_and_compile_scad``
take, so a session that has been compiling can validate without
learning a second spelling.
:param code: Alias of ``scad_code`` kept for callers that learned it.
:returns: Dict with ``valid``, ``errors``, and ``warnings``. The check
answers as ``compile_scad`` would: a setting the called module has
no parameter for is read by the module's own name when that is
certain and a measured build confirms it, and the code is valid,
with ``settings_read`` saying what was read and
``corrected_scad_code`` the code to keep; otherwise the code is
invalid and the first error lists the module's real settings.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "validate_openscad_code"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | No | Alias of ``scad_code`` kept for callers that learned it. Default: "". | |
| scad_code | No | OpenSCAD source code to validate — the same parameter name ``compile_scad`` / ``analyze_scad_code`` / ``tweak_and_compile_scad`` take, so a session that has been compiling can validate without learning a second spelling. Default: "". |