This is Final Fantasy Fables: Chocobo Tales (2006).
Final Fantasy Fables: Chocobo Tales (チョコボと魔法の絵本, Chocobo to Mahō no Ehon, lit. Chocobo and the Magical Picture Book) is an adventure game by Square Enix for the Nintendo DS.
The protagonist of the game is a young chocobo, a breed of flightless bird that exists within the Final Fantasy universe.
Chocobo, also called Poulet (プーレ, Pūre?), is the main protagonist in the Chocobo series. A young chocobo, he is the only chocobo who doesn't speak the language of the humans, but he is certainly the bravest.
According to the wiki site for the game, the plot involves a magician called Croma bringing a strange book to Chocobo Farm, where the protagonist lives. When the book is opened, a demon called Bebuzzu is released and he sucks all the chocobos into cards.
Chocobo was discovered by Shirma while still young. He was one of the many casualties of the great war, but Shirma took him to Chocobo Farm on a far away island. There he lived happily with the other Chocobos.
One day, Croma brought a strange tome to the farm. Unable to open it, Chocobo had a look at it and managed to unlock it. Upon doing so, he released the evil demon Bebuzzu, who then sucked up all the Chocobos into cards.
The opening cut-scene shows the book coming to life after a minigame is completed to open it, and sucking all the nearby chocobos, except for the protagonist, inside. The book is opened at around the 3:30 mark in the video clip below. It starts sucking the chocobos inside at around the 5:00 mark.
According to the wiki site, the gameplay involves the player finding and being transported into picture books in order to complete minigames based on adaptations of classic fairy tales.
Gameplay consists of exploring the environment to find picture books. The player is transported into the pop-up worlds of the book must complete different mini-games to unlock the next part of the story, new cards, chocobos, and books.
The stories in the books are mostly based on classical fairy tales, but are adapted to suit the Final Fantasy universe. The stories' protagonists are chocobos and other Final Fantasy creatures.
One of the stories is called "Titan and the Beanstalk" and is based on "Jack and the Beanstalk."
Titan and the Beanstalk is a story from Final Fantasy Fables: Chocobo Tales. The story is about a young boy who is robbed while having to run an errand for his mother. He then finds a magical bean, which he throws out through his window. Overnight, the bean grows into a giant stalk which he climbs all the way to the top, where he finds the home of a giant.
The story is based on Jack and the Beanstalk.
Another is called "The Ugly Chocoling" and is based on "The Ugly Duckling." The wiki description notes that the titular character of this story is revealed to be a young phoenix.
The Ugly Chocoling is a story from Final Fantasy Fables: Chocobo Tales. The story is about a young chocobo who seems to be cursed with fiery feathers on top of looking rather awkward in comparison to the rest of his peers. In two of the epilogues, it is revealed that he is in fact a young Phoenix and not a chocobo.
The story is based on The Ugly Duckling, a fairy tale written by Hans Christian Andersen, along with some references to the Parable of the Prodigal Son.