Skip to content

AgentTool creates multiple duplicate MCP connections causing massive API call duplication #3763

@doronha

Description

@doronha

When using AgentTool to call a sub-agent that uses MCP tools, ADK creates multiple MCP connections (9 observed) that all execute the same tool call in parallel, resulting in massive duplication (3x, 5x, 7x for different tools).

This causes 80% of API calls to be unnecessary duplicates, wasting resources and hitting rate limits faster.

Environment

  • ADK Version: 1.19.0
  • Python: 3.11.14
  • OS: macOS 24.6.0
  • MCP Server: GitHub Copilot MCP (https://api.githubcopilot.com/mcp/)
  • Architecture: Orchestrator agent → github_search sub-agent (via AgentTool)

Steps to Reproduce

  1. Create an orchestrator agent with AgentTool configured to call a sub-agent
  2. Configure the sub-agent to use MCP tools (e.g., GitHub MCP)
  3. Start ADK web server and invoke the orchestrator
  4. Observe logs showing multiple "Creating GitHub MCP connection" messages during startup
  5. Observe the same API call executed 3-7 times simultaneously with identical arguments

Metadata

Metadata

Assignees

Labels

tools[Component] This issue is related to tools

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions