A generic search is presented for the associated production of a Z boson or a photon with an additional unspecified massive particle X, {textrm{pp}}rightarrow {textrm{pp}} +{{textrm{Z}}}/upgamma +{{textrm{X}}} , in proton-tagged events from proton–proton collisions at sqrt{s}=13, textrm{TeV}, recorded in 2017 with the CMS detector and the CMS-TOTEM precision proton spectrometer. The missing mass spectrum is analysed in the 600–1600 GeV range and a fit is performed to search for possible deviations from the background expectation. No significant excess in data with respect to the background predictions has been observed. Model-independent upper limits on the visible production cross section of {textrm{pp}}rightarrow {textrm{pp}} +{{textrm{Z}}}/upgamma +{{textrm{X}}} are set.