Hey @maubaum
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!
Hey @maubaum, I’m sorry this is not working at expected, let’s dive into it!
Any chance you can share the error logs or traces you see when the insert fails? Checking how you are setting and calling your Agent could also help.
Also, I’m understanding that the tool itself sometimes doesn’t work - or did you mean that the Agent sometimes doesn’t trigger the tool call when expected?
Clarifying your last question: The agent is calling the tool perfectly. The problem is that the agent answer that can’t write in the database.
It’s strange because some time the agent successfully insert data on it. That’s why I consider it an intermittent problem.
I send the response to twilio to print it on user’s whatsapp.
Below the most frequent error that I received from the tool (que tool received it from the database because I checked the log in postgre): (error in Portuguese, sorry)
“não é possível executar INSERT em uma transação de leitura-apenas”
Please let me know if you need more info.
Thanks,
Mauricio
ps: I changed the tool from PostgresTools to SQLTools (and corresponding code) and worked flawlessly with the same database connection parameters. The only drawback is that it is not showing the SQL query in the terminal CLI anymore - even with show_tool_calls=True in the agent. (but this is topic for another post)
The error sounds like a transaction in read-only but we are trying to INSERT using the same transaction. It may be a problem with how the agent calls the tool or a bug with our PostgresTools. Sadly I am being unable to recreate it.
If you are still experiencing this, can you share how the agent is being called, or ideally the SQL statement that ends up raising this error?
I also hear you expect to see the run SQL statements when using SQLTools. I will make sure we adjust the code so it’s possible, makes total sense to me.