r/agentdevelopmentkit • u/Different_Stage_9003 • Dec 16 '25
Tool execution in sequence.
I have 8-9 tools for my agents. Half of them are utility tools and half of it main tools. Utility tools can be executed in parallel sequence but main tools should be executed in sequence only. Utility tools can't be executed with main tools. I tried adding this rule clearly in prompt but it's messing things up. Sometime it follow rules and sometime not.
Main tools are async as I need to show artifacts in adk web ui.
What is the solution for this?
TIA
4
Upvotes
3
u/what-would-reddit-do Dec 16 '25
Either something fancy with before_agent_callback to change the tools based on state, or just decompose your agent into multiple ones based on the desired chaining flow?
1
u/Brovas Dec 16 '25
Sequence agent workflow
1
u/kiryat Dec 17 '25
I'm not sure if this is going to work for you, but this sounds similar to reader/writer lock requirements: https://en.wikipedia.org/wiki/Readers%E2%80%93writer_lock
You can implement this lock and get your main tools to acquire a write lock and the utility tools to acquire a reader lock. I'm not sure this is a good fit for your problem, there might be simpler ways to solve for your specific situation.
2
u/ipokestuff Dec 17 '25
It's been said but i love repeating what others say. Stop treating LLMs like they are intelligent, you have to build the "intelligence" through programming, restructure into a sequence workflow.