[{'Text': '                raise ValueError(f"Stage {i} is empty")\n            stage_name = next(iter(stage))\n            if stage_name in _GBS_WRITE_STAGES:\n                raise ValueError(\n                    f"Stage {i} uses \'{stage_name}\' which is write-only. "\n                    f"Only read-only aggregation pipelines are allowed."\n                )\n\n    @dynamic_docstring([("{GBS_CHEATSHEET}", lambda: _GBS_CHEATSHEET)])\n    def read_gbs(pipeline_json: str = "", pipeline: list | None = None) -> str:\n        """Run a read-only MongoDB aggregation pipeline against GBS collections.\n\n        Primary collections:\n          - Operator        — 1300+ operators (fields: name, country, technologies)\n          - Statistics      — Subscriber counts (fields: type, operatorId, period, tech,\n                              channel, domain, subscribers, state)\n          - Sources         — Source URLs/files linked to operator/period\n          - GlobalVariables — System config (currentStatsPeriod, currentTariffsPeriod)\n\n        Provide pipeline_json (JSON string) or pipeline (Python list for internal use).\n        Supports EJSON syntax: {"$oid": "..."} for ObjectId, {"$date": "..."} for dates.\n\n        {GBS_CHEATSHEET}\n\n        Returns:\n            Formatted JSON string of results, or error message.\n'}]