Skip to content

bug(assets): multiple gateways crash/shadow agents due to duplicate tool names #1519

Description

@aidandaly24

Description

When two (or more) AgentCore Gateways are attached to a single agent, every gateway exposes the built-in semantic search tool x_amz_bedrock_agentcore_search (and may also share target tool names). The vended agent templates wire one MCP client/toolset/server per gateway into a single agent, so the identical tool names collide. The symptom differs per framework:

Framework Behavior with 2 gateways
Strands ValueError: Tool name 'x_amz_bedrock_agentcore_search' already exists. Cannot register tools with exact same name. at agent construction (hard crash)
OpenAIAgents UserError: Duplicate tool names found across MCP servers
GoogleADK last-wins dispatch shadow + duplicate FunctionDeclaration → Gemini 400
LangChain / LangGraph silent last-wins — one gateway's tool becomes unreachable

Affects the four HTTP templates that iterate gatewayProviders: strands, googleadk, langchain_langgraph, openaiagents.

Steps to Reproduce

  1. agentcore create --project-name demo --no-agent
  2. agentcore add gateway --name gw1 --authorizer-type NONE
  3. agentcore add gateway --name gw2 --authorizer-type NONE
  4. agentcore add gateway-target --gateway gw1 --name a --type mcp-server --endpoint https://mcp.exa.ai/mcp
  5. agentcore add gateway-target --gateway gw2 --name b --type mcp-server --endpoint https://mcp.deepwiki.com/mcp
  6. agentcore add agent --name demo --framework Strands --model-provider Bedrock --memory none
  7. agentcore deploy -y && agentcore invoke "hi"

Both gateways have semantic search enabled (the default), so each exposes x_amz_bedrock_agentcore_search.

Expected Behavior

The agent constructs successfully and can call tools from all attached gateways. Each gateway's tools are addressable and distinct.

Actual Behavior

The agent fails to construct (Strands/OpenAIAgents raise on the duplicate tool name), or silently drops one gateway's duplicate-named tool (GoogleADK/LangChain), so the second gateway's search tool is unreachable.

CLI Version

main (0.19.0)

Operating System

Linux

Additional Context

Each SDK ships a first-class namespacing primitive (Strands MCPClient(prefix=), GoogleADK MCPToolset(tool_name_prefix=), LangChain MultiServerMCPClient(..., tool_name_prefix=True), OpenAIAgents Agent(mcp_config={"include_server_in_tool_names": True})); the templates simply weren't using them. Fixed in #1518.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions