Peristaltic flow model is recycled to study the influence of magnetic field on the flow and heat transfer of carbon nanotubes in a non-uniform tube. Two types of carbon nanotubes, namely, single- and multi-wall carbon nanotubes are postponed in water distinctly. The pragmatic associations are used for the thermo-physical properties of CNTs in terms of the solid volume fraction of CNTs. The governing equations are simplified using long wavelength and low Reynolds number approximation. Exact solutions have been obtained for velocity, pressure gradient, the solid volume fraction of the CNTs and temperature profile. The effects of various flow and heat transfer parameters, i.e., Hartmann number , the solid volume fraction of the nanoparticles, Grashof number and heat absorption parameter are presented graphically.