Alyson Hannigan didn’t realize it at the time, but a gift her oldest daughter got on her second birthday would one day lead to a job.

It was one of the nearly 80 books in the bestselling “Fancy Nancy” series written by Jane O’Connor and illustrated by Robin Preiss Glasser. The books are about a 6-year-old girl who likes to be fancy, from her advanced vocabulary to her elaborate attire.

“The book came with a little nightgown, and she was in our hearts from then on,” Hannigan said. “As soon as I saw that it was going to become a cartoon, I called my agent and said I wanted to be part of it. I would do anything. I would be the dog.”

She got her wish — but she doesn’t play the dog. Hannigan is the voice of Claire Clancy, Nancy’s wise and caring mother, on the animated series that debuted Friday on Disney Junior.

As soon as she saw the first script, Hannigan knew the series had captured the heart and spirit of the books in a way that surpassed her expectations. Each episode features two 11-minute stories and includes original songs.

“Nancy is completely unique,” Hannigan said. “She celebrates everything fancy because that’s what she loves. She loves using big, fancy words, so vocabulary is introduced at a young age. Immediately I saw my daughter using those words, and it was so exciting to see her actively searching out a wider vocabulary.

“Nancy is so creative. But she’s also a flawed character who makes mistakes and has to learn how to handle those situations.”

Hannigan, 44, began appearing in commercials at age 4 and moved to Hollywood at 11. Her credits include “Buffy the Vampire Slayer” and “How I Met Your Mother.” She currently can be seen in “Penn & Teller: Fool Us.”

Along the way, she has done voice work on “The Wild Thornberrys,” “Rugrats,” “King of the Hill” and “Sofia the First.” She once struggled with it, but that changed when she became a mom. Maybe it was all the hours she spent reading to her daughters, she said.

Hannigan has always felt at ease in front of the camera, however. That comfort has taken her from “Buffy” to the cartoonlike zaniness of “Mother.” Toss in her work in the “American Pie” films and Hannigan has a very broad fan base. “Fancy Nancy” will add some very young TV watchers.

She jokes there was a time when she could tell when a person was approaching whether he or she was a “Buffy” or “Pie” fan, but that changed as “Mother” crossed over to both groups.

“Now I get, ‘What do I know you from?’ That’s the worst. Someone did that to my husband [“Buffy” co-star Alexis Denisof] and asked him what had he been in that she had seen,” Hannigan said. “He asked her, ‘What have you watched?’ She didn’t get the joke.”

A second season of “Fancy Nancy” is in the works. Hannigan said her daughters, now 9 and 6, are “over the moon” about their mom being part of the show.

“I am so glad it exists because it is a show I will be happy for my children to watch. We need more shows like this where a parent can relax and know that it’s not going to be scary. It’s not going to have a character who is influencing my kids in a way I am not happy with. It’s just a great, wholesome, entertaining show that celebrates being a kid.”