The Kirby ability that allows him to wield a blade is the Sword ability. It equips Kirby with a sword and gives him a set of close-range attacks based on slashing, thrusting, and aerial swordplay.
Sword is one of Kirby's classic Copy Abilities and first appeared with the Copy Ability system in Kirby's Adventure in 1993. Kirby can usually gain it by inhaling an enemy such as Sword Knight or Blade Knight. The ability's green cap and sword-bearing design have become among the most recognizable visual identities in the series.
Across different games, Sword can include standing slashes, spinning attacks, sword beams, jumping strikes, and underwater attacks. Some versions also expand it with moves inspired by Meta Knight, whose signature weapon is the Galaxia rather than Kirby's ordinary Sword ability.
Hammer, Spear, and Cutter are separate Kirby abilities, which makes them common mix-ups. Hammer focuses on heavy blunt attacks, Spear uses a polearm, and Cutter throws or projects a bladed weapon. The canonical answer to this question is specifically Sword.