How to retrieve the contents of modules in a group

Hello
I created a plugin that allows you to create and access remote databases from groups of my Elggsite.
But I have a worry because I do not know how to find all the databases in the same group. The pathis displayed in the activity of my group but I do not know how to go to retrieve the name of the database.
Someone should track it?
Thank you in advance