Skip to main content

scene_lifecycle

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.registry.capability_adapter

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

Description​

Create, load, save or close scenes and organize loaded scene objects.

Parameters​

NameTypeRequiredDescription
actionLiteral['create', 'load', 'save', 'close_scene', 'set_active_scene', 'move_to_scene']yesFeature action to perform.
namestr | None—Scene name. For Save As, the destination name.
pathstr | None—Scene path under Assets/ or Packages/. For Save As, the destination under Assets/. A bare path is relative to Assets/.
build_indexint | str | None—Unity build index (quote as string, e.g., '0').
allow_overwritebool | str | None—Allow Save As to replace an existing scene.
scene_namestr | None—Loaded scene name. For save, selects the source scene.
scene_pathstr | None—Exact loaded scene path (e.g. 'Assets/Scenes/Level2.unity'). For save, selects the source scene.
targetstr | int | None—GameObject reference (name, path, or instanceID) for move_to_scene.
remove_scenebool | str | None—For close_scene: true to fully remove, false to just unload.
additivebool | str | None—For load: true to open scene additively (keeps current scene).
templatestr | None—For create: scene template ('empty', 'default', '3d_basic', '2d_basic'). Omit for empty scene.
verifybool | None—load/save only: observe the exact affected scene with one100-object/10ms validation slice
scene_handleint | None—validate/save: exact scene_handle from get_loaded_scenes. For save, all source selectors must match one loaded scene; omit them to save the active scene.
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​

Open the Harbor fixture's Dock scene additively when it is currently closed. The currently loaded scene remains open. verify requests a bounded validation observation for the loaded scene.

MCP arguments
{
"action": "load",
"path": "Assets/Dock.unity",
"additive": true,
"verify": true
}