Skip to content

Commit 91c0ea6

Browse files
committed
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
1 parent 8f54281 commit 91c0ea6

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/google/adk/tools/transfer_to_agent_tool.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,9 @@
2626
def transfer_to_agent(agent_name: str, tool_context: ToolContext) -> None:
2727
"""Transfer the question to another agent.
2828
29-
This tool hands off control to another agent when it's more suitable to
29+
Use this tool to hand off control to another agent that is more suitable to
3030
answer the user's question according to the agent's description.
3131
32-
Note:
33-
For most use cases, you should use TransferToAgentTool instead of this
34-
function directly. TransferToAgentTool provides additional enum constraints
35-
that prevent LLMs from hallucinating invalid agent names.
36-
3732
Args:
3833
agent_name: the agent name to transfer to.
3934
"""

0 commit comments

Comments
 (0)