Implement get format context function and test functionality