Repository navigation
ApiRegistry doesn't work for newly enabled services #5478
Description
🔴 Required Information
Please ensure all items in this section are completed to allow for efficient
triaging. Requests without complete information may be rejected / deprioritized.
If an item is not applicable to you - please mark it as N/A
Describe the Bug:
API Registry no longer supports enabling/disabling MCP services. All services are available by default. However the underlying API still only returns enabled services unless a special filter is specified (in cli, you need specify --all option).
Steps to Reproduce:
Enable Maps API:
gcloud services enable mapstools.googleapis.com
Get list of MCP serversdoc:
gcloud beta api-registry mcp tools list
Note: this is what the ApiRegistry code does today. api_registry.py
So when ApiRegistry initializes, it only fetches the ENABLED services (which is no longer possible for newly enabled APIs), this means users can't use ApiRegistry with newly enabled APIs.
ADK throws this error:
File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
File "/usr/local/google/home/premram/src/mcp/next-26-keynotes/devkey/demo-1/planner_agent/__init__.py", line 15, in <module>
from . import agent
File "/usr/local/google/home/premram/src/mcp/next-26-keynotes/devkey/demo-1/planner_agent/agent.py", line 29, in <module>
tools=get_tools()
^^^^^^^^^^^
File "/usr/local/google/home/premram/src/mcp/next-26-keynotes/devkey/demo-1/planner_agent/tools.py", line 190, in get_tools
tools.extend(get_maps_tools())
^^^^^^^^^^^^^^^^
File "/usr/local/google/home/premram/src/mcp/next-26-keynotes/devkey/demo-1/planner_agent/tools.py", line 129, in get_maps_tools
return [api_registry.get_toolset(mcp_server_name=mcp_server_name)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/google/home/premram/src/mcp/next-26-keynotes/devkey/demo-1/planner_agent/tools.py", line 98, in get_toolset
toolset = super().get_toolset(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/google/home/premram/src/mcp/next-26-keynotes/devkey/demo-1/.venv/lib/python3.12/site-packages/google/adk/integrations/api_registry/api_registry.py", line 106, in get_toolset
raise ValueError(
ValueError: Fail to load 'planner_agent' module. MCP server projects/premram-dev/locations/global/mcpServers/google-mapstools.googleapis.com-mcp not found in API Registry.
INFO: 127.0.0.1:57870 - "GET /debug/trace/session/abe1d0f0-4f99-4ed6-94d7-5b661c35a061 HTTP/1.1" 200 OK
Expected Behavior:
All APIs in the registry to be fetched.
Observed Behavior:
Only enabled services are fetched.
Environment Details:
- ADK Library Version (pip show google-adk): 1.28.1
- Desktop OS:** Linux
- Python Version (python -V): 3.12.9
Model Information:
- Are you using LiteLLM:No
- Which model is being used: (e.g., gemini-3.1-pro-preview)
🟡 Optional Information
Providing this information greatly speeds up the resolution process.
Regression:
Did this work in a previous version of ADK? If so, which one?
Logs:
Please attach relevant logs. Wrap them in code blocks (```) or attach a
text file.
// Paste logs here
Screenshots / Video:
If applicable, add screenshots or screen recordings to help explain
your problem.
Additional Context:
Add any other context about the problem here.
Minimal Reproduction Code:
Please provide a code snippet or a link to a Gist/repo that isolates the issue.
// Code snippet hereHow often has this issue occurred?:
- Always (100%)
Activity
surajksharma07 commentedon Apr 25, 2026
@fieryorc The API defaults to ENABLED-only responses, which is why newly enabled services get silently missed.
As a workaround in the meantime, try passing {"filter": "state=ENABLED OR state=DISABLED"} as the initial params in ApiRegistry.init() (api_registry.py, line 64) — that should allow all servers to be fetched regardless of their current state.
Could you verify that resolves the Maps tools lookup consistently across a couple of different project setups on your end?
It'd also be great to have a unit test covering the filter param in the PR to prevent regressions.
Once both are confirmed, we'll take a close look at merging!
surajksharma07 commentedon May 22, 2026
@fieryorc — closing this out for now since we haven't heard back after the two asks last month: confirming the state=ENABLED OR state=DISABLED filter workaround holds up across different project setups, and adding a unit test to PR #5479 to cover the filter param and prevent regressions.
PR #5479 is still the right path forward — once those are in place, reviewers can take a close look at merging.
Feel free to reopen or ping on the PR once you've had a chance to update it!
fix: api-registry to fetch all services
fix: api-registry to fetch all services