Skip to content

Commit 47bb2c6

Browse files
committed
docs: Add documentation for get_components action in manage_gameobject
- Add get_components to the list of available actions in the docstring - Document required and optional parameters for get_components action - Clarify the return value structure for get_components - Improve overall documentation clarity for component data retrieval
1 parent 3063d54 commit 47bb2c6

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

UnityMcpServer/src/tools/manage_gameobject.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def manage_gameobject(
4040
"""Manages GameObjects: create, modify, delete, find, and component operations.
4141
4242
Args:
43-
action: Operation (e.g., 'create', 'modify', 'find', 'add_component', 'remove_component', 'set_component_property').
43+
action: Operation (e.g., 'create', 'modify', 'find', 'add_component', 'remove_component', 'set_component_property', 'get_components').
4444
target: GameObject identifier (name or path string) for modify/delete/component actions.
4545
search_method: How to find objects ('by_name', 'by_id', 'by_path', etc.). Used with 'find' and some 'target' lookups.
4646
name: GameObject name - used for both 'create' (initial name) and 'modify' (rename).
@@ -62,8 +62,16 @@ def manage_gameobject(
6262
search_term, find_all for 'find').
6363
includeNonPublicSerialized: If True, includes private fields marked [SerializeField] in component data.
6464
65+
Action-specific details:
66+
- For 'get_components':
67+
Required: target, search_method
68+
Optional: includeNonPublicSerialized (defaults to True)
69+
Returns all components on the target GameObject with their serialized data.
70+
The search_method parameter determines how to find the target ('by_name', 'by_id', 'by_path').
71+
6572
Returns:
6673
Dictionary with operation results ('success', 'message', 'data').
74+
For 'get_components', the 'data' field contains a dictionary of component names and their serialized properties.
6775
"""
6876
try:
6977
# --- Early check for attempting to modify a prefab asset ---

0 commit comments

Comments
 (0)