  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
show that each Seeley-de Witt coefficient $\tilde a_{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 $\tilde a_0$, $\tilde a_2$ and $\tilde a_4$ by preforming
direct calculations. This guides us to provide spectral arguments for general
terms $\tilde a_{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 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 $\Delta$ of weight 12, each term $\tilde a_{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 $\tilde a_{2n}$ lands in the 1-dimensional linear space of cusp forms of
weight 18.
