googleapis / googleapis/java-genai
Update limitations for using both search and functioncall tools
- Dominant language
- Java
- Stars
- 397
- Forks
- 125
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 41
Description
**Is your feature request related to a problem? Please describe.**
When using Gemini 2.0+ APIs with both a search tool and a functioncall tool, the API returns a error: `400 . Multiple tools are supported only when they are all search tools.`
This appears to be a limitation of the service itself and cannot be addressed within this library.
For example, if a developer registers a VertexAISearch tool to allow the model to retrieve internal documents (e.g., product manuals or company policies), and at the same time attempts to use a function tool to perform operations like submitting a request or triggering an action, the API will fail with the above error.
**Describe the solution you'd like**
Please update the relevant methods and documentation to clearly state this limitation, similar to how it was handled in [google/adk-docs#56](https://github.com/google/adk-docs/pull/56). This would help developers avoid unexpected runtime errors when configuring tools.
**Describe alternatives you've considered**
A potential workaround would be to implement a parent agent system that delegates to child agents, each handling a non-conflicting subset of tools. This pattern is discussed in [google/adk-python#53](https://github.com/google/adk-python/issues/53) and could help manage tool conflicts by separating them across isolated agents.
Contributor guide
Assessment
This issue has not been assessed yet.