First of all, make it clear you’re not denying the power or importance of prayer for believers. James was saying prayer was important, but he was writing to believers, not people who didn’t know which belief to follow. The early church was facing ‘various kinds of trials’ and James was writing to encourage them, part of which included an urge to pray for wisdom about how to respond to trials. The idea that the verse is telling anyone to pray about which church is true is taking it out of context.
7 “Ask, and it will be given to you; seek, and you will find; knock, and it will be opened to you.
So when Mormons ask God if the LDS church is true and they get a ‘yes’ answer, it must be right. There’s a few problems with that. For one thing, this passage is near the end of the Sermon on the Mount. Jesus covers at least 6 topics in chapter 7. If the verse is a model for how to know what faith is true, wouldn’t Jesus have spent more time on it?
Secondly, if the LDS interpretation of verse 7 is accurate, then why isn’t the LDS church the dominant religion in the world? Verses 8-11 are Jesus saying God certainly gives good gifts to those who seek Him. If the LDS church is true, then how is God giving good gifts to Baptists, Catholics or Seventh-day Adventists when they ask for guidance? When sincere believers of those other faiths are studying the Bible asking God to open their eyes to His truth, why doesn’t He guide them toward the true LDS faith, or at least away from the false church?
Or maybe this passage isn’t giving us a method to test which faith is true. So how can we know what teaching to trust?
8 But even if we or an angel from heaven should preach to you a gospel contrary to the one we preached to you, let him be accursed. 9 As we have said before, so now I say again: If anyone is preaching to you a gospel contrary to the one you received, let him be accursed.
So if anyone isn’t teaching the gospel revealed in the Bible, they are teaching the true gospel. Paul doesn’t mention prayer here at all. Also, notice that Paul doesn’t even leave open the possibility that he could change or update the gospel. The focus here is on the gospel they already received, not trusting in or praying about prophets.
1 John 4
1 Beloved, do not believe every spirit, but test the spirits to see whether they are from God, for many false prophets have gone out into the world. 2 By this you know the Spirit of God: every spirit that confesses that Jesus Christ has come in the flesh is from God, 3 and every spirit that does not confess Jesus is not from God.
John uses the same test as Paul. If someone teaches anything that contradicts a fundamental doctrine in the Bible, they are not from God.
There are plenty of verses that talk about prayer, but none of them describe using prayer to test prophets. The passages that actually talk about false prophets/teachers don't tell us to test them with prayer. Yes, the Bible does say we should pray to receive guidance from the Holy Spirit. But it also says we should test teachers and prophets by comparing their teachings with the Bible. Following Christ means we need to follow both of those principles.