discover: Add support for checking directories in parser API