Since the rainwater is to be used for toilet flushing purpose only there is no need for any filter. The roof needs to be kept reasonably clean that’s all. If necessary a grating can be fixed at the inlet point to the loft from the roof.
Source: https://www.indiawaterportal.org/ask/5385
Contributor: S. Vishwanath (https://www.rainwaterclub.org)