adk-docs icon indicating copy to clipboard operation
adk-docs copied to clipboard

We should document how to combine search tools with other tools

Open andrewlarimer opened this issue 3 months ago • 5 comments

Is your feature request related to a problem? Please describe. If you try to use a VertexAISearchTool with other tools, you get an error that search tools cannot be combined with other tools: "Multiple tools are supported only when they are all search tools."

The documentation doesn't describe this, even in Implementation Considerations: https://google.github.io/adk-docs/grounding/vertex_ai_search_grounding/#implementation-considerations

Describe the solution you'd like

We should include this solution that I found in the Google ADK Chat and explain what an AgentTool does to solve this problem: https://chat.google.com/room/AAAAYDpR2kM/TWgBgWeNQbU/wn5KoHWuI8U?cls=10

andrewlarimer avatar Aug 19 '25 15:08 andrewlarimer

Maybe that solution should be described in this section: https://google.github.io/adk-docs/tools/built-in-tools/#limitations

andrewlarimer avatar Aug 19 '25 16:08 andrewlarimer

@andrewlarimer I cannot open the the Google ADK Chat so that I can solve the problem, can you share it with me please ?

10Ala10 avatar Sep 06 '25 20:09 10Ala10

This is a workaround that likely is mentioned in the chat:

vertexai_search_tool = VertexAiSearchTool(
    search_engine_id=""
)

vertexai_search_agent = Agent(
    name="vertexai_search_agent",
    model=os.getenv("MODEL"),
    instruction="Use your search tool to look up facts.",
    tools=[vertexai_search_tool]
)

root_agent = Agent(
    ...
    tools=[
        AgentTool(vertexai_search_agent, skip_summarization=False),
        get_date
    ]
)

See "Using AgentTool to integrate search tools with other tools" section of this tutorial: https://www.cloudskillsboost.google/focuses/125063

Spikhalskiy avatar Oct 15 '25 21:10 Spikhalskiy

It would be nice if the documentation that comes out of this issue also provides a context for this limitation. It's not clear what makes VertexAISearchTool so special that it can't be mixed with other tools.

Spikhalskiy avatar Oct 15 '25 21:10 Spikhalskiy

Also, in recent versions of ADK, if you attempt to create an Agent with both VertexAiSearchTool and a non-search tool, the agent no longer fails. Instead, it behaves rather unexpectedly. For example, if in the lab https://www.cloudskillsboost.google/focuses/125063 in the section "Using AgentTool to integrate search tools with other tools", try to mix tools:

tools=[vertexai_search_tool, get_date]

The agent doesn't return an error; it also doesn't call vertexai_search_tool, but instead it starts calling a discovery_engine_search function that was never even registered as a tool.

Spikhalskiy avatar Oct 15 '25 21:10 Spikhalskiy