If you want to do this for your new tool, you might benefit from looking at
the function gimp_text_tool_get_popup is what sets up the context menu for
tool. It is invoked in the gimp_text_tool_class_init function, in the line
tool_class->get_popup = gimp_text_tool_get_popup;
The code is pretty hard to understand without deep knowledge of the Gtk menu
The actual contents of the context menu are where Mitch pointed you.
Gimp-developer mailing list