In the chemical reaction \( \text{CaCO}_3 \rightarrow \text{CO}_2 + \text{CaO} \), calcium carbonate (\( \text{CaCO}_3 \)) decomposes into carbon dioxide (\( \text{CO}_2 \)) and calcium oxide (\( \text{CaO} \)).
According to the law of conservation of mass, the total mass of the reactants must equal the total mass of the products. Since the scientist starts with 30 grams of \( \text{CaCO}_3 \), the total mass of the products formed will also be 30 grams.
Thus, the answer is 30 grams.