“Praying in the name of Jesus”. This simple phrase has been so abused in our modern era. It is based on a section of teaching from Jesus to His disciples where he was responding to a request from Philip for Him to show them the Father.
“Philip said to him, “Lord, show us the Father, and it is enough for us.” Jesus said to him, “Have I been with you so long, and you still do not know me, Philip? Whoever has seen me has seen the Father. How can you say, ‘Show us the Father’? Do you not believe that I am in the Father and the Father is in me? The words that I say to you I do not speak on my own authority, but the Father who dwells in me does his works. Believe me that I am in the Father and the Father is in me, or else believe on account of the works themselves. “Truly, truly, I say to you, whoever believes in me will also do the works that I do; and greater works than these will he do, because I am going to the Father. Whatever you ask in my name, this I will do, that the Father may be glorified in the Son. If you ask me anything in my name, I will do it.” (John 14:8–14, ESV)
This small phrase has been turned into a quick memory verse that is often quoted to support praying whatever we want in Jesus name and expect that God will honor that request as if it some magic incantation.
The context though really does not support this. Jesus tells them that whoever believes in Him will do works greater than the ones that he has done. Those works are the many acts that He has done throughout the gospels. Jesus tells them that it is the Father working through Him that they have seen.
He then goes on to tell them that whoever believes in Him will also do the works He did. Not only those works, but even greater works. Essentially you could say that Jesus will be accomplishing His works through us, and it will be connected to prayer.
This can be seen in what Paul teaches us in Eph 2:8-10…
“For by grace you have been saved through faith. And this is not your own doing; it is the gift of God, not a result of works, so that no one may boast. For we are his workmanship, created in Christ Jesus for good works, which God prepared beforehand, that we should walk in them.” (Ephesians 2:8–10, ESV)
We are His workmanship and the works we are to do are the works He has prepared for us. How do we know what those are? The Holy Spirit works in us in combination with the Word of God and Prayer.
I like how the IVP Bible background Commentary puts it…
In this context “name” means something like: those who seek his glory and speak accurately for him, who are genuinely his authorized representatives. Nothing could be further from the pagan magical use of names that sought to manipulate spiritual forces for one’s own ends.
There is a similar verse in John 15 where Jesus is teaching about His disciples abiding in the vine and bearing much fruit. He then tells them this…
“If you abide in me, and my words abide in you, ask whatever you wish, and it will be done for you. By this my Father is glorified, that you bear much fruit and so prove to be my disciples.” (John 15:7–8, ESV)
So, if His words abide in us, the works we do will be in line with His will and teaching. This is tied together with asking whatever we desire because our desires will be in line with His will.
We see a perfect example of this in the book of Acts…
“Now Peter and John were going up to the temple at the hour of prayer, the ninth hour. And a man lame from birth was being carried, whom they laid daily at the gate of the temple that is called the Beautiful Gate to ask alms of those entering the temple. Seeing Peter and John about to go into the temple, he asked to receive alms. And Peter directed his gaze at him, as did John, and said, “Look at us.” And he fixed his attention on them, expecting to receive something from them. But Peter said, “I have no silver and gold, but what I do have I give to you. In the name of Jesus Christ of Nazareth, rise up and walk!”” (Acts 3:1–6, ESV)
Peter was acting in the power of the Holy Spirit, accomplishing the works that God had prepared for him to walk in.
What can we learn from this? We must be careful that we do not do what the pagans did and use the name as a magical incantation to manipulate God for our own desires. Instead, we need to abide in His words and seek His will through prayer, so that we can do His works for the Glory of God.
 Keener, C. S. (1993). The IVP Bible background commentary: New Testament (Jn 14:12–14). Downers Grove, IL: InterVarsity Press.