Script / Read
script-readRead Godot C# or GDScript files from res:// and return content plus metadata, with optional line-range slicing for partial reads before updating or creating scripts.
Instructions
Read a Godot script file (C# '.cs' or GDScript '.gd') under res:// and return its content + metadata (res:// path, language, line count). Supports an optional 1-based 'lineFrom'/'lineTo' slice for partial reads (indices are clamped — out-of-range values read at-most the whole file). Pair with 'script-update'/'script-create' to write back. The file is read with Godot's FileAccess so it works on any res:// path (imported or not). Returns a structured ScriptInfo.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lineTo | No | 1-based inclusive end line of the slice (default -1 = end of file). Clamped into range. | |
| lineFrom | No | 1-based start line of the slice (default 1). Clamped into range. | |
| scriptPath | Yes | res:// path of the script to read, e.g. 'res://scripts/player.gd' or 'res://scripts/Enemy.cs'. Must end in '.cs' or '.gd'. |