Skip to main content

delete_script

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.manage_script

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

Description​

Delete a C# script by URI or Assets-relative path.

Parameters​

NameTypeRequiredDescription
uristryesURI of the script to delete under Assets/ directory, mcpforunity://path/Assets/... or file://... or Assets/...
verificationLiteral['auto', 'off']—Bounded post-delete compile/source observations.
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​

Remove the disposable PrototypeProbe.cs file from the create_script example in the same scratch project. Confirm the exact path and that the script is disposable before calling. Unity may import the change and compile afterward.

MCP arguments
{
"uri": "Assets/Scripts/PrototypeProbe.cs",
"verification": "off"
}