Agent fails to save the results from multiple tools ,and only executes first tool from the list and skips remaining

I have 5 custom tools all are working when i separately tried out with agent as well as usage lines.
The issue is when i pass them in the list only the results related to 1st tool is saving ramaining tools not executed.
I have tried with hashing first tool then the second tool worked but remainng not executed.This is the situation iam facing.

tools = [
customTool1(result_as_answer=True),
customTool2(result_as_answer=True),
customTool3(result_as_answer=True),
customTool4(result_as_answer=True),
customTool5(result_as_answer=True),
]

It’s probably that your task definition is not great enough to allow the agent to use the tools available to them.

Try playing around with that and see what happens. If that doesn’t work, try breaking up the crew into different agents with different tools, performing different tasks.

1 Like

Thank you @zinyando for your time and valuable suggestions.I initially focused upon improving the task but that didnt resolved my issue.I experimented with various configurations-with and without specifying tools,modifying instructions,specifying assigned tools in instructions,almost all possible combinations.

However creating multiple agent-task pairs partially resolved the issue .As of now 2 tools properly saved the results within a sequential process.Unfortunately remaining tools didnt performed well with respective agent-tasks.

Resolved: I finally had to rearrange the order of execution in the Crew with the partially worked 2nd method. The agents corresponding to the working tools had to be placed at the end, while the rest were moved to the top.

I’m not sure why such strange behavior occurs. When agentTool1() and agentTool2() were at the top, the remaining agents didn’t execute correctly. I double-checked everything—there were no conflicts, and I’m using the sequential mode.
Here is the format that worked:

crew = Crew(
    agents=[
        agentMain(),
        agentTool3(),
        agentTool4(),
        agentTool5(),
        
        agentTool1(),#When the 2 agents where in the first position remaining agents didnt worked
        agentTool2(),
    ],
    tasks=[
        taskMain(),
        tool3_task(),
        tool4_task(),
        tool5_task(),
        
        tool1_task(),
        tool2_task(),
    ],

1 Like

I glad you figured it out. Maybe its some implicit input dependency that was impacting performance.

1 Like