In a justice court, if the defendant pleads guilty or guilty but mentally ill, the court may, before entering such a plea or pronouncing judgment, examine witnesses to ascertain the gravity of the offense committed. If it appears to the court that a higher offense has been committed than the offense charged in the complaint, the court may order the defendant to be committed or admitted to bail or to answer any indictment that may be found against the defendant or any information which may be filed by the district attorney.
NRS 174.055