unity_create_script
Writes a C# script file into the Unity project, optionally generating a MonoBehaviour template and refreshing the asset database to compile it.
Instructions
Write a .cs file into the project (MonoBehaviour by default), optionally compiling it right away. (Unity editor offline right now: schemas are cached; calls will fail until it reconnects)
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 |
|---|---|---|---|
| body | No | class body when generating a template | |
| code | No | full file content; omit to generate a template | |
| path | Yes | Assets/Scripts/Spinner.cs | |
| compile | No | refresh the asset database now, default false | |
| baseType | No | default MonoBehaviour | |
| className | No | ||
| namespace | No | ||
| overwrite | No | default true |