From 404cb2377e691ea7db694f31d221da7ac10bcf8a Mon Sep 17 00:00:00 2001 From: stakeswky Date: Wed, 25 Feb 2026 09:40:36 +0800 Subject: [PATCH] fix: remove developer notes from transfer_to_agent docstring The function docstring included a Note section with developer guidance about using TransferToAgentTool instead. Since this docstring is sent to the model as the tool description on every invocation, the extra text wastes input tokens and increases hallucination risk. Removed the Note section while keeping the user-facing description and Args documentation intact. Fixes #4615 --- src/google/adk/tools/transfer_to_agent_tool.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/google/adk/tools/transfer_to_agent_tool.py b/src/google/adk/tools/transfer_to_agent_tool.py index 4db933999a..1fa12a6590 100644 --- a/src/google/adk/tools/transfer_to_agent_tool.py +++ b/src/google/adk/tools/transfer_to_agent_tool.py @@ -26,14 +26,9 @@ def transfer_to_agent(agent_name: str, tool_context: ToolContext) -> None: """Transfer the question to another agent. - This tool hands off control to another agent when it's more suitable to + Use this tool to hand off control to another agent that is more suitable to answer the user's question according to the agent's description. - Note: - For most use cases, you should use TransferToAgentTool instead of this - function directly. TransferToAgentTool provides additional enum constraints - that prevent LLMs from hallucinating invalid agent names. - Args: agent_name: the agent name to transfer to. """