Teaching LLMs to Refine with Tools