The spy is a very interesting character to examine in this excellent novel. Primarily, he is a figure who is used for great comic value, as his obsession with finding out the secret to Kulfi's feasts drives him, ironically, to become one of the centre dishes, as he positions himself directly above her boiling cauldron with the intention of gaining a sample from it to test, only to fall into it himself when the branch snaps.
However, whilst he is a figure of fun, at the same time, there is an obvious parallel between the spy and Sampath. Note how this is established in the following quotation:
He hated his job as a teacher in the public school, hated the boys who drew unflattering portraits of him in their notebooks and pulled faces behind his back. Often he gave them exercises to do and escaped to the staff room, where he sat staring out of the window and smoking cigarettes.
The spy, just like Sampath had been, is trapped in a job that he hates and that he wants to escape. The difference between Sampath and the spy is that the spy wants to escape this through gaining glory thanks to his discovery of what is really going on with Sampath. Uncovering some deception or fraud, the spy hopes, will gain him the success and recognition that he deserves. It is this ardent zeal for discovery and for success that drives the spy to his rather unfortunate culinary demise. The importance of the spy therefore lies in his presentation as another character who is extremely dissatisfied with his life, but who takes a very different route to try and escape this dissatisfaction.