Homeyscript to return a JSON

I am not sure if you described the problem completely, as “tag” has something to do with flows and cards.
Anyway, search the forum and find for example Can running a script from a card create a tag?
It gives some clues.