Write GDScript File
godot_write_scriptCreate or update GDScript files in Godot 4 projects by writing source code to specified paths within the editor's resource system.
Instructions
Writes (creates or overwrites) a GDScript file at the given path.
Args:
file_path (string): res:// path e.g. "res://player/player.gd"
content (string): Full GDScript source code to write.
Returns: Confirmation with the file path.
Examples:
Use when: "Create a new movement script for the Player"
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": {
"file_path": "<file_path>",
"content": "<content>"
},
"name": "godot_write_script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | res:// path for the script | |
| content | Yes | Full GDScript source code |