The introspection capabilities of Nim's macro system do not allow for "get all types" etc.
One good option is to use the Nim compiler as a library, see [https://github.com/nim-lang/Nim/blob/devel/tests/compilerapi/tcompilerapi.nim](https://github.com/nim-lang/Nim/blob/devel/tests/compilerapi/tcompilerapi.nim) for an example.