Create C# Script
unity_create_scriptCreate Unity 6 C# scripts from templates, refresh AssetDatabase, and let Unity compile them. Specify path, template, class name, and overwrite as needed.
Instructions
Create a script from a Unity 6 template. Refreshes AssetDatabase so Unity compiles it.
Args: path ('Assets/Scripts/PlayerController.cs'), template monobehaviour|scriptableobject|editor|empty, class_name (default = file name; must match file name), overwrite (default false). After creating, wait for compilation (console check) before attaching.
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>"
},
"name": "unity_create_script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Project-relative script path, e.g. 'Assets/Scripts/PlayerController.cs' | |
| template | No | Unity 6 template to generate from | monobehaviour |
| overwrite | No | Overwrite if the file already exists (default false) | |
| class_name | No | Class name (defaults to file name without extension; must match it) |