How LLM tools work under the hood