To develop machine learning (ML) models, using pre and intraoperative surgical parameters, for predicting trabeculectomy outcomes in the eyes of patients with juvenile-onset primary open-angle glaucoma (JOAG) undergoing primary surgery. The study included 207 JOAG patients from a single center who met the following criteria: diagnosed between 10 and 40 years of age, with an IOP of >22 mmHg in the eyes on two or more occasions, open angle on gonioscopy in both eyes, with glaucomatous optic neuropathy, and requiring a trabeculectomy for IOP control. Only the patients with a minimum 5-year follow-up after surgery were included in the study. A successful surgical outcome was defined as IOP ≤18 mmHg (criterion A) or 50% reduction in IOP from baseline (criterion B) 5 years after trabeculectomy. Feature selection techniques were used to select the most important contributory parameters, and tenfold cross-validation was used to evaluate model performance. The ML models were evaluated, compared, and prioritized based on their accuracy, sensitivity, specificity, Matthew correlation coefficient (MCC) index, and mean area under the receiver operating characteristic curve (AUROC). The prioritized models were further optimized by tuning the hyperparameters, and feature contributions were evaluated. In addition, an unbiased relationship analysis among the parameters was performed for clinical utility. Age at diagnosis, preoperative baseline IOP, duration of preoperative medical treatment, Tenon's thickness, scleral fistulation technique, and intraoperative mitomycin C (MMC) use, were identified as the main contributing parameters for developing efficient models. The three models developed for a consensus-based outcome to predict trabeculectomy success showed an accuracy of >86%, sensitivity of >90%, and specificity of >74%, using tenfold cross-validation. The use of intraoperative MMC and a punch for scleral fistulation compared to the traditional excision with scissors were significantly associated with long-term success of trabeculectomy. Optimizing surgical parameters by using these ML models might reduce surgical failures associated with trabeculectomy and provide more realistic expectations regarding surgical outcomes in young patients.