context_variables/1

context_variables(-VarAndNames)*

makes available a list with the variable names of the last interaction.