AppleScript: Get every group in database(s)

This should return all parents (groups & empty groups but also ordinary tags). And I just tried this successfully using the global inbox and a new, empty group:

tell application id "DNtp" to return name of every parent of inbox

To filter out ordinary tags, use e.g.

tell application id "DNtp" to return every parent of current database whose tag type is not ordinary tag