Call Hamiltonian a symplectic manifold $(M, \omega)$ equipped with a distinguished Hamiltonian $h \in \mathcal C^\infty(\mathbb R \times M)$.
Wikipedia 'Tautological form' page has a section about defining the action functional for the phase space Hamiltonian manifold $(T^*X, -d \theta, h)$, where $\theta$ is the tautological 1-form.
It defines it as $$ S = \theta(X_h) $$ where $X_h$ is the Hamiltonian flow (or better, the associated vector field). This is already a bit confusing, because usually $S$ depends on a given trajectory, but I guess one recovers the usual functional by integration: $$ \mathcal S[q] = \int_0^1 S(q(t)) \,dt $$ where $q : \mathbb R \to X$ is a given trajectory.
Q: How do I generalize this for a general Hamiltonian manifold?
In the above definition, we made essential use of the fact that $\omega$ is not just closed, but also exact, i.e. it's of the form $d\theta$ for some 1-form $\theta$. A paper I found circumvents this problem by assuming $\pi_2(M) = 0$, but the setup is somewhat confusing to me.