diff --git a/UnityMcpServer/src/tools/manage_gameobject.py b/UnityMcpServer/src/tools/manage_gameobject.py index 0f4c9bf..83ab9c7 100644 --- a/UnityMcpServer/src/tools/manage_gameobject.py +++ b/UnityMcpServer/src/tools/manage_gameobject.py @@ -40,7 +40,7 @@ def register_manage_gameobject_tools(mcp: FastMCP): """Manages GameObjects: create, modify, delete, find, and component operations. Args: - action: Operation (e.g., 'create', 'modify', 'find', 'add_component', 'remove_component', 'set_component_property'). + action: Operation (e.g., 'create', 'modify', 'find', 'add_component', 'remove_component', 'set_component_property', 'get_components'). target: GameObject identifier (name or path string) for modify/delete/component actions. search_method: How to find objects ('by_name', 'by_id', 'by_path', etc.). Used with 'find' and some 'target' lookups. name: GameObject name - used for both 'create' (initial name) and 'modify' (rename). @@ -62,8 +62,16 @@ def register_manage_gameobject_tools(mcp: FastMCP): search_term, find_all for 'find'). includeNonPublicSerialized: If True, includes private fields marked [SerializeField] in component data. + Action-specific details: + - For 'get_components': + Required: target, search_method + Optional: includeNonPublicSerialized (defaults to True) + Returns all components on the target GameObject with their serialized data. + The search_method parameter determines how to find the target ('by_name', 'by_id', 'by_path'). + Returns: Dictionary with operation results ('success', 'message', 'data'). + For 'get_components', the 'data' field contains a dictionary of component names and their serialized properties. """ try: # --- Early check for attempting to modify a prefab asset ---