Skip to content

ApiRegistry doesn't work for newly enabled services #5478

@fieryorc

Description

@fieryorc

🔴 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 here

How often has this issue occurred?:

  • Always (100%)

Metadata

Metadata

Labels

mcp[Component] Issues about MCP supportneeds review[Status] The PR/issue is awaiting review from the maintainerrequest clarification[Status] The maintainer need clarification or more information from the authortools[Component] This issue is related to tools

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions