Skip to content

transfer_to_agent tool fails with unexpected kwarg #458

@cschmidterNBTC

Description

@cschmidterNBTC

Describe the bug
transfer_to_agent tool fails with unexpected kwarg.

The root agent called the transfer_to_agent tool with a keyword argument query which raised a TypeError.

To Reproduce
Steps to reproduce the behavior:

  1. Use a multi-agent framework
  2. Let the root agent call the transfer_to_agent tool
  3. The agent may pass in an unexpected keyword argument to the tool call.

Expected behavior
Ideally, an agent should never call a tool with unexpected keyword args.
A bandage solution would be to pass kwargs through the function:

def transfer_to_agent(agent_name: str, tool_context: ToolContext, **kwargs):
  """Transfer the question to another agent."""
  tool_context.actions.transfer_to_agent = agent_name

Desktop:

  • OS: Windows 11
  • Python version: 3.13
  • ADK version: 0.3.0

Additional context
This error was encountered using gemini-2.5-pro-preview-03-25 and gemini-2.0-flash-001.

Metadata

Metadata

Labels

core[Component] This issue is related to the core interface and implementation

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions