Updates or creates script file with the provided C# code. Does AssetDatabase.Refresh() at the end. Provides compilation error details if the code has syntax errors. Use 'script-read' tool to read existing script files first.
Updates or creates script file with the provided C# code. Does AssetDatabase.Refresh() at the end. Provides compilation error details if the code has syntax errors. Use 'script-read' tool to read existing script files first.
Execute this tool directly via the MCP Plugin HTTP API:
curl -X POST http://localhost:54688/api/tools/script-update-or-create \
-H "Content-Type: application/json" \
-d '{
"filePath": "string_value",
"content": "string_value"
}'
curl -X POST http://localhost:54688/api/tools/script-update-or-create \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{
"filePath": "string_value",
"content": "string_value"
}'
The token is stored in the file:
UserSettings/AI-Game-Developer-Config.jsonUsing the format:"token": "YOUR_TOKEN"
| Name | Type | Required | Description |
|---|---|---|---|
filePath | string | Yes | The path to the file. Sample: "Assets/Scripts/MyScript.cs". |
content | string | Yes | C# code - content of the file. |
{
"type": "object",
"properties": {
"filePath": {
"type": "string",
"description": "The path to the file. Sample: \u0022Assets/Scripts/MyScript.cs\u0022."
},
"content": {
"type": "string",
"description": "C# code - content of the file."
}
},
"required": [
"filePath",
"content"
]
}
This tool does not return structured output.