write_script
Creates a C# file under Unity's Assets folder from full file contents, with an option to overwrite an existing script. Use it to add or replace C# scripts in a Unity project.
Instructions
Create a C# file under Assets/. Send the whole file. Set overwrite=true to replace one.
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>",
"contents": "<contents>"
},
"name": "write_script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| contents | Yes | ||
| overwrite | No |