For a jazz tune, I'd do the following:
pick a standard progression: 12 or 16 bar blues, or I Got Rhythm.
pick a style: straight-ahead, bop, bossa nova, swing, or ballad.
create a melody line that fits over that progression and style.
pick a subject for your tune.
write some lyrics to go with the subject.
And then you would try to fit your different notes, what you felt, in between that…and that's The Funk" - Bootsy