Linear calculations of undamped longitudinal waves in thin solar magnetic flux tubes are presented. The influence of such waves, having a variety of parameters, on the Stokes I and V profiles of eight photospheric spectral lines is studied. Diagnostics based on the Stokes parameters of the properties of flux tube waves, in particular of the amount of energy transported by them into the upper solar atmosphere, are developed. For propagating waves we find that, with an appropriate choice of spectral lines, a lower limit on the transported energy can be set by observing the zero-crossing wavelength of Stokes V, while an upper limit can be derived from the linewidths. The importance of radiative transfer effects and of the thermodynamic changes associated with the waves are pointed out. In particular, it is shown that waves with short wavelengths should not give rise to a large oscillation of the Stokes V zero-crossing wavelength, although they produce very asymmetric and broad line profiles. Some qualitative comparisons with the observational data are considered. It is shown that observations with sufficiently high spatial and temporal resolution should be able to distinguish between standing and propagating waves on the basis of line parameters of photospheric spectral lines alone. The influence of flux tube waves on spatially and temporally unresolved observations is also considered. It is found that only downwards propagating linear tube waves produce the correct sign of the Stokes V asymmetry. Furthermore, linear tube waves cannot simultaneously reproduce the observed amplitude and area asymmetry of the Stokes V line profiles, even in the presence of a downflow outside the flux tubes. This suggests that either longitudinal waves in solar magnetic flux tubes behave non-linearly, or that the thin-tube approximation breaks down.