When the PCs first encounter the Worm That Likes Books, he will befriend them and inform them about anything dangerous in the surrounding rooms. He will point out the pile of half-nibbled adventurers stowed in the back and his small pile of literature right next to it. Then he will offer to dig a tunnel to wherever the PCs need to go.
Regardless of wherever the PCs need to go, the Worm That Likes Books doesn't trust areas beyond the small perimeter it operates in. Roll a d20 and reference the dungeon's key; that's the room he'll tunnel to. Replace with a bigger or smaller die as necessary.
He consider this a freebie.
The next time the PCs visit The Hungry Worm That Likes Books, roll on the wandering monster table and he'll want to eat the monster rolled. From now on he will refuse to dig anymore tunnels until the PCs bring him what he wants to eat or something good to read. If the PCs insist he dig them a tunnel, he'll eat them. If they return empty-handed, he'll eat them. If they bring him a trash novel, he'll eat them.
HD 6 AC Chain Constrict d8
Swallow - The Round after a successful Constrict The Worm That Likes Books will swallow the grappled creature whole. The swallowed creature suffers 1d8 damage per round from muscle contractions and stomach acids. Attacking him from the inside is easier said than done. The cramped space only permits attacks with weapons no larger than a dagger, and the attacker loses a roll.