A Framework for Testing and Adapting REST APIs as LLM Tools