Skip to main content

prefab_inspect

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​

Inspect prefab metadata or a bounded hierarchy page. Inspection may load assets or invoke user-defined callbacks.

Parameters​

NameTypeRequiredDescription
actionLiteral['get_info', 'get_hierarchy']yesFeature action to perform.
prefab_pathstr | None—Prefab asset path (e.g., Assets/Prefabs/MyPrefab.prefab). For save/close, when supplied it must match the current Prefab Stage.
page_sizeint | None—Page size 1-500. get_hierarchy defaults to 50; list_overrides defaults to 100.
cursorstr | None—get_hierarchy opaque cursor; keep identical page_size/max_depth.
max_depthint—get_hierarchy inclusive depth scope, root=0; default 64, maximum 128.
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​

Read the first page of a prefab hierarchy before opening the prefab for editing. Replace the example path with the target prefab. Use the reported cursor if more nodes are available.

MCP arguments
{
"action": "get_hierarchy",
"prefab_path": "Assets/Prefabs/Player.prefab",
"page_size": 25
}