Cancer is the world's most common disease and the second biggest cause of mortality among humans. Brain tumors are protracted forms of cancer due to their aggressive nature, varied features, and dismal relative survival. Pretreatment, segmentation, and detection of infected tumor regions utilizing magnetic resonance (MR) images is a big issue, and radiologists or clinical personnel must complete time-consuming and arduous activities. The brain tumors differ in appearance and resemble normal tissue within the tumor, Convolution Neural Network (CNN) cannot fully exploit spatial correlations. The paper presents an approach to automatically detect brain cancers using deep learning techniques with capsule networks. The proposed strategy allows the capsule network to access the tissue surrounding the tumor without interfering with the tumor's primary function. A modified capsule network design for brain tumor classification has been developed in which a complete tumor boundary is used as an additional input to the pipeline to boost the capsule networks. The proposed method can efficiently classify brain images with 98.5 percent sensitivity, 97.82 percent specificity, and 98.35 percent accuracy, according to the results of cross-validation.