I don't exactly know how to do this but, if I was in your position and I did, I would deconstruct the stock tool.exe and figure out how it compiles tags, and do the reverse.