Computational problems come in a variety of types, for example:
- decision problem: given input $x$, output "YES" if $x$ belongs to a fixed set $L$ and output "NO" otherwise,
- function problem: given input $x$, output a $y$ such that $(x, y)$ belongs to a fixed relation $R$,
- optimization problem: given objective $f$ and constraints $g$, output $x$ that maximizes $f$ while satisfying $g$,
- sampling problem: given a probability distribution $P$, output a sample $x\sim P$.
Together with the computational model and resource bounds, the type of relevant problems is a key ingredient in a definition of a computational complexity class.
Traveling Salesman Problem
The class NP is defined as a class of decision problems. The Traveling Salesman Problem formulated as the task of finding the shortest loop traversing all nodes in a graph exactly once is a function problem and thus - as you suspected in your question - does not belong to NP. However, TSP has a decision version which for a given graph and a threshold length $w$ asks whether there is a loop traversing all nodes in the graph exactly once and whose total length is less than $w$. This problem belongs to NP. The certificate is the path and it is easy to see that it can be checked in polynomial time on a deterministic Turing machine.
Similarly, the problem of finding the ground state of a spin glass system is a function problem and hence not in NP. The problem has a decision variant which for a given spin glass system and an energy threshold $E$ asks whether there is an energy eigenstate with energy below $E$. Under certain assumptions about the Hamiltonian, this problem belongs to NP.
For example, in the absence of a transversal field, the Ising model is diagonal in a product basis and thus has a product eigenstate for every eigenvalue. Each product state admits a description of size polynomial in the number of sites. We can use such a state as a certificate that can be checked in polynomial time to prove that the model has a state with energy below the threshold $E$.
The expression "TSP is NP-complete" is an imprecise shortcut for "the decision version of TSP is NP-complete". Leaving "decision version" implicit is generally acceptable because only decision problems may be meaningfully declared to be NP-complete.
That said, note that it does make sense to say that a computational problem $P$ which is not a decision problem is NP-hard. See Wikipedia for an explanation.