A surgical device 10 has a handle assembly 12 and an elongated member 18 extending distally from the handle assembly. A tool assembly 104 is mounted to a distal end of the elongated member. The tool assembly has a cartridge assembly 108 having a plurality of staples. The tool assembly further has an anvil assembly 106. At least one of the anvil assembly and the cartridge assembly is movable in relation to each other between open and closed positions. At least one of the anvil assembly and the cartridge assembly has at least a portion 150 configured for transitioning between a longitudinally extended state and a longitudinally retracted state. A transitioning mechanism is configured to transition at least one of the anvil assembly and the cartridge assembly between the extended and retracted states.