Skip to main content

inspect_serialized_object

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: scripting_ext  ·  Module: services.tools.inspect_serialized_object

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

Description​

Inspect one exact Component or ScriptableObject instance ID through SerializedObject. The initial Unity ID lookup MAY load a previously unloaded asset and invoke OnEnable or serialization callbacks before type/context admission. No explicit asset search/import/save is performed. Fields returns one immediate level; value reads one canonical property; array reads only the requested slice. Use canonical paths such as groups.Array.data[2].values. Managed and object references remain terminal descriptors. With values enabled, managed references distinguish null, resolved, missing_type and unknown by host-local ID. Pages are live, not snapshots: restart after edits/reload; IDs, field paths and array indices are not persistent identity. Maximum 64 records, 16 path hops, 2048 charged managed operations and 65536 response bytes. These limits do not bound synchronous Unity serialization or native lookup complexity. Native editability is separate from setter-specific supported input shapes; enum names are recommended for component writes. Requires a compatible Editor; no legacy fallback or reload retry.

Parameters​

NameTypeRequiredDescription
instance_idintyes
modeLiteral['fields', 'value', 'array']—
property_pathstr—
page_sizeint—
after_pathstr—
start_indexint—
include_valuesbool—
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​

List the first 20 top-level serialized fields of a loaded component. Replace the number with the exact instance ID from a recent component inspection. With values disabled the example reads field descriptors.

MCP arguments
{
"instance_id": 43210,
"mode": "fields",
"page_size": 20,
"include_values": false
}