write_script
Writes GDScript or other text files under res://, validating GDScript first so non-compiling code is refused before it reaches disk.
Instructions
Write a GDScript (or other text, e.g. .cs) file under res://. GDScript is validated first by default — refuses code that doesn't compile; non-.gd files (C#, config…) are written as-is (use build_csharp to compile-check C#). Set validate=false to force. Reads the file back (disk_verified).
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": {
"path": "<path>",
"content": "<content>"
},
"name": "write_script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | res:// path, e.g. res://player.gd | |
| content | Yes | ||
| validate | No | validate before writing (default true) |