Geometrical properties of spacetime are difficult to study in nonperturbative approaches to quantum gravity like causal dynamical triangulations (CDT), where one uses simplicial manifolds to define the gravitational path integral, instead of Riemannian manifolds. In particular, in CDT one only relies on two mathematical tools, a distance measure and a volume measure. In this paper, we define a notion of scalar curvature, for metric spaces endowed with a volume measure or a random walk, without assuming nor using notions of tensor calculus. Furthermore, we directly define the Ricci scalar, without the need of defining and computing the Riemann or the Ricci tensor . For this, we make use of quantities, like the surface of a geodesic sphere, or the return probability of scalar diffusion processes, that can be computed in these metric spaces, as in a Riemannian manifold, where they receive scalar curvature contributions. Our definitions recover the classical results of scalar curvature when the sets are Riemannian manifolds. We propose two methods to compute the scalar curvature in these spaces, and we compare their features in natural implementations in discrete spaces. The defined generalized scalar curvatures are easily implemented on discrete spaces, like graphs. We present the results of our definitions on random triangulations of a 2D sphere and plane. Additionally, we show the results of our generalized scalar curvatures on the quantum geometries of 2D CDT, where we find that all our definitions indicate a flat ground state of the gravitational path integral. Published by the American Physical Society 2024