Earthquake moment tensors and focal depths are crucial to assessing seismic hazards and studying active tectonic and volcanic processes. Although less powerful than strong earthquakes (M 7+), moderately strong earthquakes (M 5–6.5) occur more frequently and extensively, which can cause severe damages in populated areas. The inversion of moment tensors is usually affected by insufficient local waveform data (epicentral distance ) in sparse seismic networks. It would be necessary to combine local and teleseismic data (epicentral distance 30°–90°) for a joint inversion. In this study, we present the generalized cut‐and‐paste joint (gCAPjoint) algorithm to jointly invert full moment tensor and centroid depth with local and teleseismic broadband waveforms. To demonstrate the effectiveness and explore the limitations of this algorithm, we perform case studies on three earthquakes with different tectonic settings and source properties. Comparison of our results with global centroid moment tensor and other catalog solutions illustrates that both non‐double‐couple compositions of the focal mechanisms and centroid depths can be reliably recovered for very shallow () earthquakes and intermediate‐depth events with this software package.