thank you @KaushalVachhani, I want this as an AI Tool. I actually created this logic as a databricks job and used it as a tool in an agent. But it did not work as expected. Let me explore this further.