On the day of a history test at school, Bart gets a stomachache after accidentally eating a jagged metal Krusty-O with his breakfast cereal. Lisa is the only one who believes him, however, and Homer and Marge send him to school anyway. Bart struggles through the test, and after finally convincing Mrs. Krabappel that he is actually ill, she lets him go and see the nurse. Bart collapses on the medical room floor, and is taken to Springfield General Hospital where he undergoes surgery from Dr. Hibbert and Dr. Nick, as it emerges he has appendicitis. While visiting Bart in the hospital, Lisa meets her hero, jazzman Bleeding Gums Murphy, in a bed in another ward. Spending time with Bleeding Gums, Lisa learns more about his past, including his brief time in stardom, where he appeared on TV with Steve Allen, and on The Cosby Show, as well as recording his only album, "Sax On the Beach". The two also spend time playing jazz, lifting the spirits of the hospital residents.
Later, Bleeding Gums lends Lisa his saxophone for her school recital. It starts off terribly (owing to most of the orchestra having their appendixes removed so they could miss school), but Lisa gets up and performs a rousing solo routine, becoming the star of the show. Returning to the hospital the next day, Lisa is saddened to learn that Bleeding Gums has died. Lisa is the only person who attends Bleeding Gums's funeral, and she vows to make sure that everyone in Springfield knows the name Bleeding Gums Murphy. Bart, meanwhile, sues Krusty the Clown and is given a $100,000 settlement after Krusty attempts to prove that the jagged metal Krusty-O is harmless at a press conference, but collapses in pain despite only eating a regular krusty-o. However, after Bart's attorney Lionel Hutz takes his "legal fees", Bart is left with only $500, but does not realize the con and is thrilled with the amount. Hutz and his accomplices gleefully flee with their ill-gotten gains.
Still stricken with grief, Lisa decides that the best way to honor Bleeding Gums' memory is by having his album played at the local jazz station. Lisa spots it in the Android's Dungeon store for $250, but after hearing that Bleeding Gums is dead, Comic Book Guy doubles the price to $500. Bart then walks in with his $500 to buy the ultimate pog with Steve Allen's face. However, after remembering that Lisa was the only one who believed him about his stomachache, Bart decides to buy the album with his money. Lisa thanks him for it, but is worried he might never see that kind of money again. Bart reassures her that he's okay with it and reveals he's got a new plan. He shows Lisa the new Krusty O's cereal with flesh-eating bacteria prizes in every box. When the station plays one of Bleeding Gums's songs, Lisa is disappointed because the station's tiny range still prevents anyone from hearing it. Lightning then strikes the antenna, giving it extra power and projecting it into every radio in Springfield, showing Homer, Grampa and Chief Wiggum enjoying the song, though Wiggum is accidentally trapped by a poison cloud when the jazz transmission overtakes his police radio. Lisa is finally satisfied. After proclaiming "that was for you Bleeding Gums," she turns to leave, but not before Bleeding Gums appears from the heavens to tell Lisa that she had made "an old jazz man happy". After saying a final goodbye, Lisa and Bleeding Gums jam to "Jazzman" one last time.