How to handle accident calling for functions?

Hello there,

I was wondering if there is such approach i can use in order to avoid accident calling for function.

I have a scenario where sometimes the function is being triggered while the query wasnt really related to function calling causing wrong response.

So how do you fix/tune such issue ?