Where can i find the wrench in DSaF2?

I want to complete that ending but i have no clue where the wrench is. Where can i find it?