validate_script
Compile and validate GDScript source or res:// files without writing them, reporting errors and editor warnings to catch API mistakes before scripts are saved.
Instructions
Parse/compile GDScript WITHOUT writing it. Pass 'content' (source) or 'path' (res://). Returns whether it compiles, plus the GDScript warnings the editor would show (unused variables, shadowing, integer division...). Use before write_script to catch hallucinated APIs. A class_name from a file written outside the editor is registered first. When validating 'content' destined for an existing file, ALSO pass its 'path' so a real cross-file class_name duplicate is still reported.
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_script"
}
}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 | ||
| warnings | No | also report GDScript warnings (default true; runs a ~0.3 s headless check) |