Script Create
script_createCreate or overwrite GDScript or C# files in a Godot project, register them with the editor, and validate GDScript syntax. C# scripts are saved as text for compilation in the editor.
Instructions
Create a script file on disk: GDScript (.gd, validated) or C# (.cs, text only).
Writes content to the path. Overwrites if it exists. Registers the
file with the editor. New files include data.cleanup.rm listing
the file and, when supported by the editor, its .uid sidecar;
overwrite omits it.
.gd: source is parse-validated and the response carries
diagnostics (diagnostics_status="checked"); an already-loaded
script is refreshed in place. .cs: written as text only — Godot AI
does not compile .NET, so diagnostics_status="not_checked" and
validation_hint says to build the project (editor Build button
or dotnet build) to see compiler errors. dotnet_editor
reports whether the connected editor build has .NET at all. Any
other extension is rejected; use filesystem_manage op="write_text".
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | res:// path ending in .gd or .cs (e.g. "res://scripts/player.gd"). | |
| content | No | GDScript or C# source. Empty creates a blank file. | |
| session_id | No | Optional Godot session to target. Empty = active session. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||