In a bowl add chicken along with all the ingredients listed under 'For marination'.Mix well until the spices coat the chicken pieces well.Keep aside until required.Heat 1 tsp coconut oil in a pan ,add grated coconut black peppercorns ,cloves ,cardamom,cinnamon and fennel seeds.Fry the coconut until it turns golden brown ,stirring continuously over medium flame.
Once it is golden brown ,reduce the flame to low and add kashmiri chili powder,coriander powder and turmeric powder.
Fry stirring continuously for about a minute,until the colour turns slightly darker .Transfer this onto a plate and allow to cool completely.Place this roasted coconut mixture in the bowl of a food processor /blender (do not add water)and process for about a minute.Scrape the sides of the blender using a spatula and continue to process for another minute or two ,or until it forms a fine paste.(If you find it difficult to grind to a smooth paste,add 1 or 2 tbsp of water to the blender )Keep aside until required.
Heat oil in a pan,add the mustard seeds and let it splutter.Now add the curry leaves,ginger,garlic,green chilies,shallots,onion and coconut pieces.Saute well until onion turns golden brown.
Once the onion has caramelised ,add tomato and cook well until it turns mushy.Make sure you stir well in between to avoid burning.
Now add the marinated chicken,stir well and cook over medium high flame for about 5 minutes.Reduce the flame to medium and add the coconut paste ,garam masala and sufficient quantity of water.Add more salt if required.
Cover and cook until the chicken is done and the gravy turns thick.Make sure you stir well in between to avoid burning.Switch off the flame, add more curry leaves and few tomato slices to garnish ,if desired.Serve with appam ,porotta or steamed rice.