Is it possible to get list of models by tag selector inside macro

according to this reply can’t run dbt CLI commands from a macro.
But, tags look to be part of the graph context variable, which is accessible from a macro