Skip to content

Getting increase latency with MCPToolset after version 1.16.0 #3237

@hcadioli

Description

@hcadioli

Describe the bug
After upgrading to ADK v1.16, requests that stream tool outputs show a noticeable latency increase. Tracing reveals that McpToolset.get_tools() is invoked multiple times during a single streamed interaction, repeatedly reconstructing the same tool list. This results in unnecessary network/IPC work and object creation, compounding latency.

To Reproduce
Steps to reproduce the behavior:

  1. Install 'google-adk==1.16.*' (or build from main including v1.16 changes).
  2. Configure an MCP server with a stable set of tools (no dynamic changes at runtime).
  3. Run a streaming generation that calls MCP tools (e.g., tool-calling with partial deltas).
  4. Observe logs/trace: get_tools() is called several times per request; end-to-end latency increases vs. pre-1.16.

Expected behavior

  • get_tools() should only resolve/build the tool list once per McpToolset instance (or per session), and reuse it when the set of available tools is unchanged.
  • Streaming should not incur repeated, identical tool discovery costs.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. macOS, Linux, Windows]
  • Python version(python -V):
  • ADK version(pip show google-adk):

Model Information:

  • Are you using LiteLLM: Yes/No
  • Which model is being used(e.g. gemini-2.5-pro)

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

Labels

mcp[Component] Issues about MCP support

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions