Adaptive Tool Generation with Models as Tools and Reinforcement Learning