45
Views
8
Comments
Solved
Agentic AI Action Calling giving exception

I am using tool call using Action Calling Feature and set a Call Condition as below.

My Tool Call Action is hit 3 times and after that it should return response to the user but instead I am getting an exception and getting following message.

Can any one know how I can set condition that my Action calling will stop after 2 times and get a result based on 2nd response of the Action (Tool).

2023-10-16 05-50-48
Shingo Lam
Solution

I think you misunderstand the main part. Max Token is the only thing that can let the agent response with a success. In your case, its Call Condition that will throw an error when the expression = TRUE

2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP

Hi,

Not an expert on the Agent Workbench, but should the condition not be different like:

 TotalCallsCount <= 2    

Regards,

Daniel

2022-12-30 07-28-09
Navneet Garg

I changed the condition but still the same issue.

2023-10-16 05-50-48
Shingo Lam

No, @Daniël Kuhlmann , its opposite. The call condition is to stop the agent loop when the condition is TRUE, so the >2 is correct one

Hi @Navneet Garg , the call condition will throw the exception when it is true. So you should set the actions output more specific to let the agent stop with the appropriate content output instead

2025-05-31 09-56-11
TheSubuIyer
Champion

@Navneet Garg  if you set a condition for the max tools calls it will throw an exception and error out. You need to handle that in the code.

The Max Tool Calls will always throw an exception.

  • To stop the agent after it has made a total of thirty action calls (regardless of the number of loops): TotalCallsCount < 25

If you want to limit the number of tool calls and still get an output you may have to implement a work around. A better approach may be to Limit max tokens as it may have a similar impact but might give you a valid output.

Hope this helps.

2025-05-31 09-56-11
TheSubuIyer
Champion

Find the link for reference: https://success.outsystems.com/documentation/outsystems_developer_cloud/building_apps/build_ai_powered_apps/agentic_apps_in_odc/ai_agent_actions/

2022-12-30 07-28-09
Navneet Garg

Yes, I already checked it and it says

The agent concludes its reasoning loop when it meets a Call Condition. The agent then generates a final response to the user based on the information gathered up to that point. 

But in my case the agent is not generating final result and giving me the exception. 

2023-10-16 05-50-48
Shingo Lam
Solution

I think you misunderstand the main part. Max Token is the only thing that can let the agent response with a success. In your case, its Call Condition that will throw an error when the expression = TRUE

2025-05-31 09-56-11
TheSubuIyer
Champion

All conditions except for Max tokens will throw an exception and error out. Only in the case of Max tokens you will get an output.


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.