Following our result on rationality of the spectral action for Bianchi type-IX cosmological models, which suggests the existence of a rich arithmetic structure in the action, we study the arithmetic and modular properties of the action for an especially interesting family of metrics, namely SU (2)-invariant Bianchi IX gravitational instantons. A variant of the previous rationality result is first presented for a time-dependent conformal perturbation of the triaxial Bianchi IX metric which serves as a general form of Bianchi IX gravitational instantons. By exploiting a parametrization of the gravitational instantons in terms of theta functions with characteristics, we then show that each Seeleyde Witt coefficientã 2n appearing in the expansion of their spectral action gives rise to vector-valued and ordinary modular functions of weight 2. We investigate the modular properties of the first three termsã 0 ,ã 2 andã 4 by preforming direct calculations. This guides us to provide spectral arguments for general termsã 2n , which are based on isospectrality of the involved Dirac operators. Special attention is paid to the relation of the new modular functions with well-known modular forms by studying explicitly two different cases of metrics with pairs of rational parameters that, in a particular sense, belong to two different general families. In the first case, it is shown that by running a summation over a finite orbit of the rational parameters, up to multiplication by the cusp form ∆ of weight 12, each termã 2n lands in the 1-dimensional linear space of modular forms of weight 14. In the second case, it is proved that, after a summation over a finite orbit of the parameters and multiplication by G 4 4 , where G 4 is the Eisenstein series of weight 4, eachã 2n lands in the 1-dimensional linear space of cusp forms of weight 18.Mathematics Subject Classification (2010). 58B34, 11F37, 11M36.