The keys function returns a vector of valid key signature IDs. These IDs are how key signatures are specified throughout tabr, including in the other helper functions here via key.
Like the other functions here, is_sharp and is_flat are for key signatures, not single pitches whose sharp or flat status is always self-evident from their notation.
Major and minor keys are also self-evident from their notation, but is_major and is_minor can still be useful when programming.