The plot in my story revolves around a certain ability of the MC that is normally not available, unless the circumstances are just right. Therefore, it is not mentioned in the story as a solution to the MC's problem, as the ability is considered to be something from a legend and not really an option. I want to avoid to just throw the existence of said ability into the climax of the story as a deus ex machina. However, it also makes no sense to talk about it extensively beforehand due to above reasons. I'm also afraid that talking too much about it will give away the climax to the reader.
How do I foreshadow the existence of this ability effectively without telling too much or too little? Will an anecdote or a story 'from legend' be what I'm looking for? When do I talk about it?