write_script
Write or overwrite GDScript files in a Godot project, creating parent directories if missing, so scripts can be added or modified directly.
Instructions
Write or overwrite a GDScript file in a Godot project. Creates parent directories if needed. Use validate_script afterward to check for syntax errors.
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": {
"projectPath": "<projectPath>",
"scriptPath": "<scriptPath>",
"content": "<content>"
},
"name": "write_script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | The GDScript source code to write | |
| scriptPath | Yes | Path to the script file (relative to project, e.g., "scripts/player.gd") | |
| projectPath | Yes | Path to the Godot project directory |