From c38fc330d2d18ba1ca205e061a84ed36777e971b Mon Sep 17 00:00:00 2001 From: David Sarno Date: Mon, 29 Sep 2025 20:10:52 -0700 Subject: [PATCH] fix: reject 'name' parameter for find action in all cases - Simplify validation to reject 'name' parameter whenever present for find action - Remove ambiguity when both 'name' and 'search_term' are provided - Update error message to clarify that 'name' should be removed --- UnityMcpBridge/UnityMcpServer~/src/tools/manage_gameobject.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/UnityMcpBridge/UnityMcpServer~/src/tools/manage_gameobject.py b/UnityMcpBridge/UnityMcpServer~/src/tools/manage_gameobject.py index 27c0c0a..c36a09d 100644 --- a/UnityMcpBridge/UnityMcpServer~/src/tools/manage_gameobject.py +++ b/UnityMcpBridge/UnityMcpServer~/src/tools/manage_gameobject.py @@ -71,10 +71,10 @@ def register_manage_gameobject_tools(mcp: FastMCP): try: # Validate parameter usage to prevent silent failures if action == "find": - if name is not None and search_term is None: + if name is not None: return { "success": False, - "message": "For 'find' action, use 'search_term' parameter, not 'name'. Example: search_term='Player', search_method='by_name'" + "message": "For 'find' action, use 'search_term' parameter, not 'name'. Remove 'name' parameter. Example: search_term='Player', search_method='by_name'" } if search_term is None: return {