Isocyanides are the only class of organic compounds which possess a divalent carbon. They react like a geminal nucleophilic/electrophilic synthon with oxidation of the C(II) atom to C(IV), which parallels the chemistry of carbenes and carbon monoxide.
Some of the most common methods for synthesizing isocyanides involve the dehydration of formamides. Various dehydrating agents (phosgene, phosphorus oxychloride) are used in the presence of a base (pyridine/TEA). In the follow reaction, however:
I'm unable to understand the role of p-TsCl, and can't work out the reaction mechanism.