In sub_sgents, there is a situation where agents cross-call tools that do not belong to them
As shown in the figure, my update_plan_status_tool tool is bound under the observe_agent, but action_agent tried to call this tool during execution and got an error: ValueError: Function update_plan_status is not found in the tools_dict.
+1 we also started seeing this behavior when using 'adk web' from the latest version (1.14.0+)
Actually, after doing some versioning checks - this bug appears to have been introduced in version 1.9.0 of google-adk. My agents works fine in adk web in version 1.8.0 and anything prior to that.
[EDIT] I lied, this is happening in versions 1.8.0 and 1.7.0 as well...
@Jacksunwei hello, Is there any progress on this issue?
any update on this? We were able to reduce the frequency of the error by including tool specific instructions in the system prompt...but still not 100% resolved, and feels like a bad pattern to continue using. Is there at least a better way to catch an incorrect tool from being called, and have the agent retry? An example would be very helpful
Does anyone have a minimal agent code that can reproduce this?
Does anyone have a minimal agent code that can reproduce this?有没有人能提供一个能复现此问题的最小化智能体代码?
@reyolivo
Hi @devin2255 and @reyolivo,
Thanks for reporting this issue. After investigating the codebase, I can confirm that ADK correctly scopes tools per agent - each agent only receives its own tools in the LLM request, not tools from other agents.
Debugging Steps:
-
Check the actual prompt sent to the LLM - Run
adk webwith verbose logging:adk web -vLook at the system instruction and tool declarations when
action_agentis active. Verify whetherupdate_plan_status_toolincorrectly appears in either:- The tool declarations for
action_agent - The system instruction mentioning this tool
- The tool declarations for
-
If the tool doesn't appear in the prompt, this is likely model hallucination - the LLM is generating function calls for tools that don't exist in its available tool list.
Recommended Solutions:
-
Use
ReflectAndRetryToolPlugin(available since v1.16.0) to automatically handle tool hallucinations:from google.adk.plugins.reflect_retry_tool_plugin import ReflectAndRetryToolPlugin # Add to your app configuration -
Strengthen agent instructions - Explicitly list available tools in each agent's instruction:
action_agent.instruction = """ You have access to ONLY these tools: tool_a, tool_b, tool_c. Do NOT attempt to call any other tools. """ -
Provide examples - Show the agent correct tool usage patterns in the instruction.
This matches what @reyolivo found - adding tool-specific instructions reduces the error frequency by helping the model stay focused on its available tools.
Let us know if the debug logging shows the unavailable tool in the prompt - that would indicate a different issue.
This issue has been automatically marked as stale because it has not had recent activity for 7 days after a maintainer requested clarification. It will be closed if no further activity occurs within 7 days.
This has been automatically closed because it has been marked as stale for over 7 days.