| name | assets-modify |
| description | Modify an asset file in the project. Use 'assets-get-data' first to inspect the asset structure before modifying. Not allowed to modify asset files in the 'Packages/' folder — modify them in 'Assets/'. Three modification surfaces are available (content, pathPatches, jsonPatch) — see the skill body for details. |
Assets / Modify
Three modification surfaces
Use whichever fits the task:
content — full SerializedMember override (legacy, backwards compatible).
pathPatches — list of {path, value} pairs routed through Reflector.TryModifyAt.
jsonPatch — JSON Merge Patch routed through Reflector.TryPatch.
When more than one is supplied they run in this order: jsonPatch → pathPatches → content. At least one is required.
Path syntax
fieldName, nested/field, arrayField/[i], dictField/[key]. Leading #/ is stripped.
How to Call
unity-mcp-cli run-tool assets-modify --input '{
"assetRef": "string_value",
"content": "string_value",
"pathPatches": "string_value",
"jsonPatch": "string_value"
}'
For complex input (multi-line strings, code), save the JSON to a file and use:
unity-mcp-cli run-tool assets-modify --input-file args.json
Or pipe via stdin (recommended):
unity-mcp-cli run-tool assets-modify --input-file - <<'EOF'
{"param": "value"}
EOF
Troubleshooting
If unity-mcp-cli is not found, either install it globally (npm install -g unity-mcp-cli) or use npx unity-mcp-cli instead.
Read the /unity-initial-setup skill for detailed installation instructions.
Input
| Name | Type | Required | Description |
|---|
assetRef | any | Yes | Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders. |
content | any | No | Optional. The asset content. It overrides the existing asset content (legacy path). |
pathPatches | any | No | Optional. List of path-scoped patches routed through Reflector.TryModifyAt. |
jsonPatch | any | No | Optional. JSON Merge Patch (RFC 7396, extended with [i]/[key] keys) routed through Reflector.TryPatch. |
Input JSON Schema
{
"type": "object",
"properties": {
"assetRef": {
"$ref": "#/$defs/AIGD.AssetObjectRef"
},
"content": {
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember"
},
"pathPatches": {
"$ref": "#/$defs/System.Collections.Generic.List(AIGD.PathPatch)"
},
"jsonPatch": {
"anyOf": [
{
"type": "string"
},
{
"type": "object",
"additionalProperties": true
}
]
Output
Output JSON Schema
{
"type": "object",
"properties": {
"result": {
"$ref": "#/$defs/System.String-1"
}
},
"$defs": {
"System.String-1": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"result"
]
}