Handle tool exception in teams

I have a team managing some agents. So I chat with the coordinator. But sometimes an agent makes errors doing a tool call. For example, it tries to call a tool that does not exist. How can I try-catch this behaviour so that a response is returned to the leader? Otherwise, the user would be never given a response.

Thank you,

Rita

Hey @rbeltrami, thanks for reaching out and supporting Agno. I’ve shared this with the team, we’re working through all requests one by one and will get back to you soon.If it’s urgent, please let us know. We appreciate your patience!

Hi @rbeltrami
Ideally an agent should never call a tool that doesn’t exist, but in practice models can sometimes get confused and call the tools with wrong parameters, especially when there are lots of tools or their names are similar. Also some models are also better at tool calling than others.To handle this, we make sure tools have clear names, argument names, and docstrings so the model picks the right one.
Though there shouldn’t be a case where entirely a wrong tool is called.

That said, thanks for raising this issue , our team will work on having a timeout feature to resolve the long waits . Meanwhile, can you please try Agno 2.0 and see it it solved the issue

Thanks

Hi @monalisha ,

thank you for your reply. I am having errors using your standard toolkit functions, like for example VisualizationTools. So I can change the model, but I don’t know how to “improve” tools description. Is it eventually possibile to do so, like for example “overwriting” the content of the toolkit?

I will also try to update Agno version.

Best Regards,

Rita

Hi @rbeltrami , Thanks for clarifying.
If its happening with the toolkit functions then I think it must be some other issue or model issue , But let us know how it goes with Agno 2.0.
Thanks