What is meant is the first sense—namely, taking him as a means because he is a cause for attaining the request; yet at times the wording may be intended as an oath.
A case in point is the ḥadīth of the three men who sought refuge in a cave, a well-known report found in the two Ṣaḥīḥs and elsewhere.
A boulder rolled down and shut them in, whereupon they said, “Let each of you supplicate Allah by the deed he deems his best.”
One of them said, “O Allah, I had a female cousin whom I loved more than any man loves a woman. She demanded one hundred dinars from me, and when I brought them to her she said, ‘Servant of Allah, fear Allah and do not break the seal except lawfully.’ So I left the gold with her and departed. If I did that solely seeking Your Face, then relieve us.” The rock shifted and opened a gap through which they could see the sky.
The second said, “O Allah, I had two elderly parents, and I never served milk in the evening to my family or my servants before them. One day I was delayed gathering wood and did not return until they had fallen asleep. I milked their evening drink and found them sleeping, and I disliked to give it to my family or my servants before them. I therefore stood with the cup in my hand, waiting for them to awaken, until the dawn light appeared. They awoke and drank their milk. O Allah, if I performed that deed purely for Your Face, then relieve us of what we are suffering from this rock.” The rock moved again, yet they were still unable to leave.