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
main
David Sarno 2025-04-13 10:38:53 -07:00
parent 3063d54071
commit 47bb2c6363
1 changed files with 9 additions and 1 deletions

View File

@ -40,7 +40,7 @@ def register_manage_gameobject_tools(mcp: FastMCP):
"""Manages GameObjects: create, modify, delete, find, and component operations. """Manages GameObjects: create, modify, delete, find, and component operations.
Args: 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. 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. 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). 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'). search_term, find_all for 'find').
includeNonPublicSerialized: If True, includes private fields marked [SerializeField] in component data. 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: Returns:
Dictionary with operation results ('success', 'message', 'data'). Dictionary with operation results ('success', 'message', 'data').
For 'get_components', the 'data' field contains a dictionary of component names and their serialized properties.
""" """
try: try:
# --- Early check for attempting to modify a prefab asset --- # --- Early check for attempting to modify a prefab asset ---