Script / Update
script-updateOverwrites an existing Godot C# or GDScript file under res:// with new source, validates GDScript before writing, and leaves invalid files untouched. Fails if the path is missing.
Instructions
Overwrite an EXISTING Godot script file (C# '.cs' or GDScript '.gd') under res:// with the provided source. Fails if no file exists at the path — use 'script-create' to create one. GDScript content is syntax-validated before write (invalid '.gd' is rejected and the existing file is left untouched); C# is accepted as-is (no in-editor compiler) and the post-write build settle surfaces compile errors. For a '.cs' file the editor filesystem reimports and BOUNDED-settles before returning (then 'script-build' loads the changed type); a '.gd' file only needs a filesystem update so the editor re-parses it. Use 'script-read' to inspect the current content first. Returns a structured ScriptInfo.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"scriptPath": "<scriptPath>",
"content": "<content>"
},
"name": "script-update"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | New source code to write (replaces the file's entire content). | |
| scriptPath | Yes | res:// path of the existing script to overwrite, ending in '.cs' or '.gd'. |