Skip to content

ApiRegistry doesn't work for newly enabled services #5478

Closed

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%)

Activity

  1. added
    mcp[Component] This issues is related to MCP support
    tools[Component] This issue is related to tools
    on Apr 24, 2026
  2. added theissue type on Apr 24, 2026
  3. surajksharma07 commented on Apr 25, 2026

    @surajksharma07
    Collaborator

    @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!

  4. added
    request clarification[Status] The maintainer need clarification or more information from the author
    needs review[Status] The PR/issue is awaiting review from the maintainer
    on Apr 25, 2026
  5. surajksharma07 commented on May 22, 2026

    @surajksharma07
    Collaborator

    @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!

  6. added a commit that references this issue on Jun 17, 2026
    81b8067
  7. added a commit that references this issue on Aug 11, 2026
    d158e2d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

mcp[Component] This issues is related to 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