add_autoload
Register a new autoload in a Godot project by specifying name, script path, and optional singleton flag. Works without a running Godot process.
Instructions
Register a new autoload in a project. autoloadPath accepts "res://..." or a project-relative path (auto-prefixed). singleton defaults true (accessible globally by name). No Godot process required. Warning: autoloads initialize in headless mode — a broken script will crash every subsequent headless op; validate before adding. Returns plain-text confirmation with the registered name, path, and singleton flag. Errors if an autoload with the same name already exists; use update_autoload to modify.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectPath | Yes | Path to the Godot project directory | |
| autoloadName | Yes | Name of the autoload node (e.g. "MyManager") | |
| autoloadPath | Yes | Path to the script or scene (e.g. "res://autoload/my_manager.gd" or "autoload/my_manager.gd") | |
| singleton | No | Register as a globally accessible singleton by name (default: true) |