validate_script
Validate GDScript syntax and API usage before writing, catching hallucinated calls and class_name conflicts. Pass source content or res:// path; include path for existing files to detect real duplicates.
Instructions
Parse/compile GDScript WITHOUT writing it. Pass 'content' (source) or 'path' (res://). Returns whether it compiles — use before write_script to catch hallucinated APIs. Scripts whose class_name is already registered validate correctly (v1.9; the old false 'hides a global class' error is fixed); when validating 'content' destined for an existing file, ALSO pass its 'path' so a real cross-file class_name duplicate is still reported as the error it is.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | res:// path — the file to validate, or (with content) the file the content is destined for | |
| content | No |