Skip to content

feat(agent_registry): the Console code snippet uses AgentRegistry(project=...).published_skills.get(name=...), which does not exist in ADK#7137

Description

@codebee-aoki

馃敶 Required Information

Is your feature request related to a specific problem?

The Google Cloud Console (Agent Registry > Skill Registry > skill detail page) shows a Python code snippet for using a published skill with ADK. The same snippet is also shipped inside every published skill archive as COPYTOREPOTOUSE.txt. It looks like this (project/skill from our catalog):

from google.adk.agents.llm_agent import LlmAgent
from google.adk.integrations.agent_registry import AgentRegistry
from google.adk.tools import skill_toolset

PROJECT_ID = "my-project"
LOCATION = "global"
SKILL_NAME = "projects/my-project/locations/global/skills/cloud.google.com-google-cloud-networking-observability"

agent_registry = AgentRegistry(project=PROJECT_ID, location=LOCATION)
skill = agent_registry.published_skills.get(name=SKILL_NAME)
skill_tools = skill_toolset.SkillToolset(skills=[skill])

root_agent = LlmAgent(
    model="gemini-3.6-flash",
    name="sample_agent",
    instruction="Use the tools you have access to help answer user questions",
    tools=[skill_tools],
)

This snippet cannot run on any released google-adk (checked 2.9.1 and main @ 3a06a86):

So a developer who copies the snippet from the Console gets a TypeError on the first line, and the nearest working alternative does not work for Google-published skills either. We hit this the day Skill Registry launched and it is still the case today.

Describe the Solution You'd Like

Make the Console snippet true, i.e. add a synchronous, resource-name based skill accessor on AgentRegistry that returns a google.adk.skills.models.Skill ready to be passed to SkillToolset(skills=[...]):

registry = AgentRegistry(project_id="my-project", location="global")
skill = registry.published_skills.get(
    name="projects/my-project/locations/global/skills/cloud.google.com-google-cloud-networking-observability"
)
SkillToolset(skills=[skill])

Suggested semantics:

  • published_skills.get(name=<full resource name>) fetches the skill metadata, follows the ?alt=media redirect for the default revision, and returns a Skill (same loader as GCPSkillRegistry). A list(...) / search(query=...) pair on the same namespace would mirror the existing list_mcp_servers / search_mcp_servers / list_agents / search_agents methods.
  • Accepting the full resource name sidesteps the id-validation problem in GCPSkillRegistry rejects every Google-published skill: dotted ids (cloud.google.com-*) fail name validation in get_skill and search_skills聽#7136: the id is not interpolated into a URL by the client, so only "is this a well-formed projects/*/locations/*/skills/* name" needs checking.
  • Synchronous, like the rest of AgentRegistry, so it can be used at module import time in agent.py (the snippet's use case). GCPSkillRegistry stays the async registry for SkillToolset(registry=...).
  • Either accept project= as an alias of project_id, or fix the snippet; whichever is easier, but today the two disagree.

Impact on your work

We build agents on Agent Engine that consume Google-published skills from Agent Registry. The Console tells users to write code that does not exist, and the alternative path is blocked by two other bugs, so there is currently no way to use a Google-published skill from ADK at all. Not blocking a launch, but it has been confusing since the Skill Registry launch and it is the first thing a new user of the feature runs into.

Willingness to contribute

Yes, I can send a PR for the AgentRegistry side once the maintainers confirm the intended shape (the Console/template side is presumably owned by another team; happy to have this routed there as well).


馃煛 Recommended Information

Describe Alternatives You've Considered

Additional Context

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent config[Component] This issue is related to the Agent Config interface and implementation

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions