[{'Text': 'Edited point-topic-mcp/src/point_topic_mcp/tools/gbs_tools.py:\n\n```diff\n@@ -45,7 +45,7 @@\n     def _admin_url(operator_id: str) -> str:\n         return f"{ADMIN_BASE}/operators/{operator_id}/statistics"\n \n-    def _run_status_query(country: str, operator: str | None, period: str | None) -> dict:\n+    def _run_status_query(country: str, operator: str | None = None, period: str | None = None) -> dict:\n         """Single mongosh call: resolve current period + $lookup aggregation."""\n         match: dict = {"country": country, "isArchived": {"$ne": True}}\n         if operator:\n@@ -92,7 +92,7 @@\n         if not country:\n             return "Error: country is required (e.g. \'United Kingdom\')"\n \n-        data = _run_status_query(country.strip() or None, operator.strip() or None, period.strip() or None)\n+        data = _run_status_query(country, operator.strip() or None, period.strip() or None)\n         if data.get("error"):\n             return f"Query failed: {data[\'error\']}"\n \n@@ -103,11 +103,8 @@\n         if operator.strip():\n             if not docs:\n                 return f"Operator \'{operator}\' not found in \'{country}\'."\n-            name = docs[0]["name"]\n-            oid = docs[0].get("_id", {}).get("$oid", "?")\n-            techs = docs[0].get("techs", [])\n-            stats = docs[0].get("stats", [])\n-            return _fmt_operator(name, oid, techs, stats, tp, country)\n+            d = docs[0]\n+            return _fmt_operator(d["name"], d.get("_id", {}).get("$oid", "?"), d.get("techs", []), d.get("stats", []), tp, country)\n \n         return _fmt_country(docs, cp, country)\n \n@@ -206,9 +203,9 @@\n             return f"Invalid quarter: {quarter}"\n         if year < 1990 or year > 2100:\n             return f"Invalid year: {year}"\n-        if not (web_url := (url.strip() or None)):\n-            if not file_url or not file_url.strip():\n-                return "At least one of url or file_url required"\n+        web_url = url.strip() or None\n+        if not web_url and not (file_url and file_url.strip()):\n+            return "At least one of url or file_url required"\n         raw_file = file_url.strip().lower() if file_url and file_url.strip() else ""\n         if raw_file and not (raw_file.startswith("s3://") or raw_file.startswith("http")):\n             return "file_url must be s3://... or http(s)://..."\n@@ -219,15 +216,14 @@\n \n         final_file_url = None\n         if raw_file:\n-            raw = file_url.strip()  # type: ignore[union-attr]\n             try:\n-                if raw.startswith("s3://"):\n-                    b, k = s3u.parse_s3_uri(raw)\n+                if raw_file.startswith("s3://"):\n+                    b, k = s3u.parse_s3_uri(file_url)  # type: ignore[arg-type]\n                     dk = s3u.build_sources_dest_key(operator_id, year, quarter, k.rstrip("/").rsplit("/", 1)[-1] or "file")\n                     final_file_url = s3u.copy_to_sources_bucket(b, k, dk)\n                 else:\n-                    body, ct = s3u.download_from_url(raw)\n-                    fn = urlparse(raw).path.rstrip("/").rsplit("/", 1)[-1] or "download"\n+                    body, ct = s3u.download_from_url(file_url)  # type: ignore[arg-type]\n+                    fn = urlparse(file_url).path.rstrip("/").rsplit("/", 1)[-1] or "download"  # type: ignore[arg-type]\n                     dk = s3u.build_sources_dest_key(operator_id, year, quarter, fn)\n                     final_file_url = s3u.upload_to_sources_bucket(body, ct, dk)\n             except RuntimeError as e:\n@@ -240,10 +236,3 @@\n         iid = mongo.insert_one_source({"operatorId": operator_id, "year": year, "quarter": quarter,\n                                         "type": type, "url": web_url, "fileUrl": final_file_url})\n         return f"Created source {iid}\\n  {op.get(\'name\',\'\')} | {year}Q{quarter} | type={type} | url={web_url or final_file_url or \'none\'}"\n-\n-else:\n-    _STUB_MSG = "GBS tools require PT_RESEARCH_DATABASE_URI environment variable."\n-\n-    def get_status(country="", operator="", period="", ctx=None): return _STUB_MSG\n-    def add_statistic(type="", **kw): return _STUB_MSG\n-    def create_source(operator_id="", **kw): return _STUB_MSG\n\n```'}]