It was introduced by Doˇsli ́c and Ivica et al. (Journal of Mathematical chemistry, 56(10) (2018): 2995–3013), as an innovative graph-theoretic topological identifier, the Mostar index is significant in simulating compounds’ thermodynamic properties in simulations, which is defined as sum of absolute values of the differences among nu(e|Ω) and nv(e|Ω) over all lines e = uv ∈ Ω, where nu(e|Ω) (resp. nv(e|Ω)) is the collection of vertices of Ω closer to vertex u (resp. v) than to vertex v (resp. u). Let C(n, k) be the set of all n-vertex cacti graphs with exactly k cycles and T(n, d) be the set of all n-vertex tree graphs with diameter d. It is said that a cacti is a connected graph with blocks that comprise of either cycles or edges. Beginning with the weighted Mostar index of graphs, we developed certain transformations that either increase or decrease index. To advance this analysis, we determine the extreme graphs where the maximum and minimum values of the weighted edge Mostar index are accomplished. Moreover, we compute the maximum weighted vertex Mostar invariant for trees with order n and fixed diameter d.