Did it actually work? Or, was it ultimately ineffective?
Oh my, no. No, not at all. Not in the least.
In terms of the Mongols themselves, it wasn't even really employed in any strategic sense. Certain sections were manned and reinforced, where it made strategic sense to do so, but large stretches of the Wall had been abandoned and left to the elements for centuries by the time Genghis and Subotai came galloping in. It could simply be ridden over... or around. In fact, the very dynastic order that could potentially have incorporated the structure into its plans were themselves acutely aware at just how ineffective it would have been for any kind of "grand-scale shield" against northern invaders... because they were themselves the descendants of very similar northern invaders.
The Jin Dynasty was ruled by an ethnicity called the Jurchen, who broadly came from Manchuria, near the Heilong River. The were ethno-linguistically quite similar to the Mongols who would eventually supplant them, to the point where apparently even their spoken languages were at least somewhat mutually-intelligible. Several generations prior, the Mongols had themselves migrated out of the Heilong River region, westward into the Central Asian steppes.
Anyways, the Jin had swept in and crushed an even earlier non-Han dynasty called the Liao Dynasty, which had been ruled over by the Khitan people. They'd been at war with the "actual" Chinese regime of the era - the Song - for quite a while, and the Jurchen had been one of their vassals. They got irked and rebelled, and then steamrolled the Khitan, driving their leaders westward into what is today Xinjiang in the far west of China, where they set up a rump-state known as the Western Liao by the Chinese, and Kara-Khitai by most others. As for the rest of the northern populations - Chinese, Khitan, etc - they were absorbed into the nascent Jurchen state. Then, these Jurchen Jin simply decided to inherit the obligations owed to the Liao by the Song, and demanded tribute payments. The Song - rich, haughty, and militarily not exactly at-their-best - thought they'd go ahead and recover the territories they'd been forced to cede to the Liao, and attacked... so the Jin drove them completely out of northern China, all the way south of the Yangtze River.
Why am I telling you all this?
Because territorially, what that meant for the Jin Dynasty that ruled the entire north of China at the dawn of the 13th century, was that the crumbling ruins of the Great Wall weren't on the border... or even in a place that could reasonably be considered, like, a good defensive spot anymore. Some of the most valuable lands in the north, as far as military strategy of the day went, were actually beyond the Wall, in places such as the Ordos Loop (that's where the Yellow River turns 90º north for a few hundred miles, turns east, then turns and goes all the way back south, before resuming its eastward flow. The Ordos Loop was some of the best territory to breed and raise warhorses in the empire, which were absolutely crucial to any army at the time, but especially the cavalry-centric strategies of the Jurchen. They could not reasonably be expected to repair and man an ancient fortification that would, in the event of an attack, leave the engine of their war machine out in the cold. It'd be a bit like the US deploying its military to defend against an invasion - relying on gas-guzzling jets and tanks, but purposely leaving the oilfields of Texas and Alaska defenseless.
Moreover, the Great Wall was never even intended - even at its apex in the Han, and later in the Ming - as some unbreachable barrier against largescale invasion. It had only ever been intended as a way to repel smallscale raiders, and to funnel any invaders to more predictable paths that could actually be guarded. But that had long fallen out of favor - again often for both cost and territorial reasons - in favor of constructing networks of garrisoned forts that could act in concert with one another against foes, as well as smaller-scale, but no less impressive defensive city walls that could take the worst anyone, anywhere could throw at them. Such measure were far more economical and, frankly, effective than some crumbling pile of stones out in the middle of nowhere stretching on for thousands of miles.
Finally, as for the Mongols themselves, they didn't even try to go over or through the Wall. They did the other thing - they went around it. One of the first "external" foes Genghis Khan's united Mongol empire set their sights on was the Tangut Kingdom of Western Xia, which was sandwiched between Kara Khitai and Jin, in what's today mostly Gansu and Inner Mongolia. Rather than attacked in a "normal way," Genghis and the Mongols took an insane, seemingly impossible detour through about 800 miles of the heart of the Gobi Desert, popping out exactly where they were not expected and devastating the Tangut defenders. Fortunate for W. Xia, the Mongols were absolutely garbage at siegecraft (they hadn't captured Chinese engineers yet) and, after nearly drowning their own army while trying to divert a river and flood the Tangut capital city, Genghis magnanimously "let" the Tangut king surrender to him and pledge loyalty to the Great Khan.
That meant, that they Mongols could then just turn east and ride straight through the Gansu Corridor (already on the south side of the Wall, to the amount that the Wall even extends that far west in the first place) straight into the heart of the Yellow River Valley and the Jin Dynasty.
So, to summarize: No, the Great Wall did not work to defend against the Mongols. It wasn't meant to. It hadn't worked at all in centuries. It was largely an abandoned, weather-beaten ruin. It was strategically irrelevant. And in any case, thousands of miles long static-defensive structures were understood even in the 13th century be an incredible waste of time, money, and manpower that fundamentally could not respond to the fluid nature of warfare.
____________
Sources:
Allsen, Thomas. "The rise of the Mongolian Empire and Mongolian rule in northern China" in The Cambridge History of China [TCHoC], v. 6: Alien Regimes & Border States.
Dunnel, Ruth. "The Hsi Hsa" in TCHoC v. 6.
Franke, Herbert. "The Chin Dynasty" in TCHoC v.6.
Levine, Ari Daniel. "The Reigns of Hui-tsung (1100–1126) and Ch’in-tsung (1126–1127) and the Fall of the Northern Sung" in TCHoC v. 5: The Sung Dynasty and Its Precursors.
McLynn, Frank. Genghis Khan: The Conquests, His Empire, His Legacy.
Tao, Jing-shen. "The Move to the South and the Reign of Kao-tsung" in TCHoC v. 5.
Rossabi, Morris. Genghis Khan: His Life and Times.
____________
Another source is my podcast, The History of China! 6-years running, almost 190s episodes, and currently in the mid-Yuan!