From c674ecbb27a8efeffb21a1d9ebac9aeabf0e25e0 Mon Sep 17 00:00:00 2001 From: Prem Ramanathan Date: Fri, 24 Apr 2026 11:53:17 -0700 Subject: [PATCH 1/2] Fix api-registry to fetch all services - API Registry no longer supports enabling apis. To get all the apis, one needs to pass additional filter to fetch the apis. This allows the library to fetch all available apis. --- src/google/adk/integrations/api_registry/api_registry.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/google/adk/integrations/api_registry/api_registry.py b/src/google/adk/integrations/api_registry/api_registry.py index 966ad68b7d..f40062948a 100644 --- a/src/google/adk/integrations/api_registry/api_registry.py +++ b/src/google/adk/integrations/api_registry/api_registry.py @@ -61,7 +61,10 @@ def __init__( page_token = None with httpx.Client() as client: while True: - params = {} + params = { + # Include all the apis including disabled ones. API registry no longer supports enabling APIs. + "filter": "enabled=false" + } if page_token: params["pageToken"] = page_token From 7ffd84a8ddb62de5d95188d9306f425d71822ecd Mon Sep 17 00:00:00 2001 From: Prem Ramanathan Date: Fri, 24 Apr 2026 15:38:34 -0700 Subject: [PATCH 2/2] Fix unittests --- .../integrations/api_registry/test_api_registry.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/unittests/integrations/api_registry/test_api_registry.py b/tests/unittests/integrations/api_registry/test_api_registry.py index 7edaee9fec..203bf68064 100644 --- a/tests/unittests/integrations/api_registry/test_api_registry.py +++ b/tests/unittests/integrations/api_registry/test_api_registry.py @@ -91,7 +91,7 @@ def test_init_success(self, MockHttpClient): "Authorization": "Bearer mock_token", "Content-Type": "application/json", }, - params={}, + params={"filter": "enabled=false"}, ) @patch("httpx.Client", autospec=True) @@ -120,7 +120,7 @@ def test_init_with_quota_project_id_success(self, MockHttpClient): "Content-Type": "application/json", "x-goog-user-project": "quota-project", }, - params={}, + params={"filter": "enabled=false"}, ) @patch("httpx.Client", autospec=True) @@ -176,7 +176,7 @@ def test_init_with_pagination_success(self, MockHttpClient): "Authorization": "Bearer mock_token", "Content-Type": "application/json", }, - params={}, + params={"filter": "enabled=false"}, ) mock_client_instance.get.assert_called_with( f"https://cloudapiregistry.googleapis.com/v1beta/projects/{self.project_id}/locations/{self.location}/mcpServers", @@ -184,7 +184,7 @@ def test_init_with_pagination_success(self, MockHttpClient): "Authorization": "Bearer mock_token", "Content-Type": "application/json", }, - params={"pageToken": "next_page_token"}, + params={"filter": "enabled=false", "pageToken": "next_page_token"}, ) @patch("httpx.Client", autospec=True)