[{'Text': 'Edited point-topic-mcp/src/point_topic_mcp/tools/gbs_query_tools.py:\n\n```diff\n@@ -145,36 +145,24 @@\n         except ValueError as e:\n             return f"Error: {e}"\n \n-        # Determine which collection to run against\n-        # Default to Statistics (most useful), detect from pipeline\n+        # Auto-detect target collection from $match keys\n         collection = "Statistics"\n         first_stage = pipeline[0] if pipeline else {}\n-        if "$match" in first_stage:\n-            match = first_stage["$match"]\n-            # If matching on name/country/technologies, likely going against Operator\n-            if isinstance(match, dict):\n-                match_keys = set(match.keys())\n-                if match_keys & {"name", "country", "isArchived", "technologies", "asn", "_id"}:\n-                    if "type" not in match_keys and "period" not in match_keys and "state" not in match_keys:\n-                        collection = "Operator"\n-\n-        # If $lookup references a collection, also check first stage for collection hints\n-        used_collections = _find_used_collections(pipeline)\n-        # If pipeline looks like it targets GlobalVariables\n-        if used_collections or collection == "Statistics":\n-            pass  # auto-detect below\n-\n-        # Better auto-detect: if $match keys look like a specific collection\n         if "$match" in first_stage:\n             match = first_stage["$match"]\n             if isinstance(match, dict):\n                 mkeys = set(match.keys())\n                 if "isCurrent" in mkeys or "currentStatsPeriod" in mkeys:\n                     collection = "GlobalVariables"\n-                elif "operatorId" in mkeys or "type" in mkeys or "period" in mkeys or "state" in mkeys or "subscribers" in mkeys:\n+                elif (\n+                    "operatorId" in mkeys or "type" in mkeys or "period" in mkeys\n+                    or "state" in mkeys or "subscribers" in mkeys\n+                ):\n                     collection = "Statistics"\n                 elif "year" in mkeys and "quarter" in mkeys:\n                     collection = "Sources"\n+                elif mkeys & {"name", "country", "isArchived", "technologies", "asn", "_id"}:\n+                    collection = "Operator"\n \n         # Ensure target collection is allowed\n         if collection not in ALLOWED_COLLECTIONS:\n\n```'}]