We present an all-optical mass spectrometry technique to identify trapped ions. The new method utilizes laser-cooled ions to determine the mass of a co-trapped dark ion with sub-dalton resolution within a few seconds. We apply the method to identify the first controlled synthesis of cold, trapped RaOH + and RaOCH3 + . These molecules are promising for their sensitivity to time and parity violation that could constrain sources of new physics beyond the standard model. The nondestructive nature of the mass spectrometry technique may help identify molecular ions or highly charged ions prior to optical spectroscopy. Unlike previous mass spectrometry techniques for small ion crystals that rely on scanning, the method utilizes a Fourier transform which is inherently broadband and comparatively fast. The technique's speed provides new opportunities for studying state-resolved chemical reactions in ion traps.