Scripts
scriptCreate, edit, validate, and lint Godot code files, returning compile diagnostics to catch errors before running.
Instructions
GDScript (and C#) files. Creating/writing/editing a .gd reloads it in the editor and returns compile diagnostics immediately — fix errors before running. Use templates for common controllers.
Actions:
create: {path, content? | template?: 'default'|'empty'|'platformer_2d'|'topdown_2d'|'fps_3d'|'state_machine'|'autoload_events', extends?, class_name?, actions?: {jump,left,right,up,down}, attach_to?: node path, scene?} new script, optionally attached.
read: {path, outline?} script source (and its outline).
write: {path, content} replace the whole script; returns diagnostics (errors + warnings).
edit: {path, edits: [{old, new, replace_all?}]} exact replacements; returns diagnostics.
lint: {path | paths} full language-server diagnostics (all errors and warnings such as unused variables, shadowing, unsafe casts) for scripts on disk.
validate: {path? | paths? | content?} compile check. No args = every script in the project.
outline: {path} extends, class_name, signals, exported vars, functions with line numbers.
attach: {path: node, script, scene?}
detach: {path: node}
references: {symbol} find usages across the project.
classes: {} project class_name classes.
templates: {} available templates.
open: {path, line?} show the script to the user in the script editor.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | res:// script path (node path for attach/detach). | |
| edits | No | Exact replacements. | |
| scene | No | res:// scene to operate on; opened in the editor if needed. Defaults to the currently edited scene. | |
| action | Yes | What to do. See the tool description for each action's parameters. | |
| script | No | Script path for attach. | |
| symbol | No | Identifier to search for. | |
| actions | No | Input action names for templates. | |
| content | No | Script source. | |
| extends | No | Base class for templates. | |
| template | No | Template name. | |
| attach_to | No | Node path to attach the new script to. | |
| class_name | No | Global class name to declare. |