Skip to main content

script_change_set

Auto-generated from the Python tool registry. Do not hand-edit outside <!-- examples:start --><!-- examples:end --> blocks — the generator (tools/generate_docs_reference.py) will overwrite them.

Group: core  ·  Module: services.tools.script_change_set

Maturity: stable (support status; independent of enabled state, readiness and permissions).

Description​

Prepare, apply, inspect or recover 1–256 existing C# source replacements as one bounded change set. Prepare takes final contents plus each original raw-byte SHA256 (including BOM), validates each file and retains a local recovery manifest without source writes. Apply checks all original source/metadata preconditions before writes. Failures retain ordered confirmed, restored or uncertain outcomes; recovery never overwrites a changed external source. This is not a filesystem-wide transaction, semantic rename or callback rollback. UTF-8 BOM/newlines and metadata are preserved. Default verification='off' does not schedule a refresh; apply with verification='auto' checks the final confirmed selection once and returns findings or the original pending run. Unity automatic/deferred source import may still compile changed scripts.

Parameters​

NameTypeRequiredDescription
actionLiteral['prepare', 'apply', 'status', 'recover']yes
fileslist[ScriptChangeFile] | None—prepare only: ordered final source buffers.
change_set_idstr | None—apply/status/recover: identifier returned by prepare.
validationLiteral['basic', 'standard', 'comprehensive', 'strict']—
verificationLiteral['off', 'auto']—
unity_instancestr | int | None—Target Unity instance for this call: Name@hash or hash prefix; an integer selects only that exact port over stdio and is rejected over HTTP. Read mcpforunity://instances for available targets. Omit to use the legacy active selection or the sole available instance.

Returns​

A dict containing the Unity response. The exact shape depends on the action.

Examples​

Inspect a change set before choosing whether to apply or recover it. Replace the example ID with the ID returned by prepare and use its original Editor connection.

MCP arguments
{
"action": "status",
"change_set_id": "0123456789abcdef0123456789abcdef"
}