The shear strength characteristics of rock materials, specifically internal friction angle and cohesion, are critical parameters for the design of rock structures. Accurate strength prediction can significantly reduce design time and costs while minimizing material waste associated with extensive physical testing. This paper utilizes experimental data from rock samples in the Himalayas to develop a novel machine learning model that combines the improved sparrow search algorithm (ISSA) with Extreme Gradient Boosting (XGBoost), referred to as the ISSA-XGBoost model, for predicting the shear strength characteristics of rock materials. To train and validate the proposed model, a dataset comprising 199 rock measurements and six input variables was employed. The ISSA-XGBoost model was benchmarked against other models, and feature importance analysis was conducted. The results demonstrate that the ISSA-XGBoost model outperforms the alternatives in both training and test datasets, showcasing superior predictive accuracy (R² = 0.982 for cohesion and R² = 0.932 for internal friction angle). Feature importance analysis revealed that uniaxial compressive strength has the greatest influence on cohesion, followed by P-wave velocity, while density exerts the most significant impact on internal friction angle, also followed by P-wave velocity.