Repairing Tool Calls Using Post-tool Execution Reflection and RAG
On the map: LLM agents and tool use → Tool learning and function calling
Abstract (arXiv)
Agentic systems interact with external systems by calling tools such as Python functions, REST API endpoints, or command line tools such as kubectl in Kubernetes. These tool calls often fail for various syntactic and semantic reasons. Some less obvious semantic errors can only be identified and resolved after analyzing the tool's response. To repair these errors, we develop a post-tool execution reflection component that combines large language model (LLM)-based reflection with domain-specific retrieval-augmented generation (RAG) using documents describing both the specific tool being called and troubleshooting documents related to the tool. For this paper, we focus on the use case of the kubectl command line tool to manage Kubernetes, a platform for orchestrating cluster applications. Through a larger empirical study and a smaller manual evaluation, we find that our RAG-based reflection will repair kubectl commands such that they are both more likely to successfully execute (pass rate) for 55% of our models evaluated and 36% more likely to correctly answer the user query on average. We find that troubleshooting documents improve pass rate compared to official documentation by an average of 10%.
Key facts. No citing papers in the map yet (data through 7 Oct 2026). Placed in Tool learning and function calling, one of 16 directions in LLM agents and tool use. Builds on 11 of its 24 references that are in the map. First posted on arXiv 17 Oct 2025.
Builds on
11 of 24 references.
Closest ancestors · 5
Same direction, newest first
- 2024ToolScan: A Benchmark for Characterizing Errors in Tool-Use LLMs20 Nov
- 2024Toolshed: Scale Tool-Equipped Agents with Advanced RAG-Tool Fusion and Tool Knowledge Bases18 Oct
- 2024NESTFUL: A Benchmark for Evaluating LLMs on Nested Sequences of API Calls4 Sep
- 2023ToolLLM: Facilitating Large Language Models to Master 16000+ Real-world APIs31 Jul
- 2023Gorilla: Large Language Model Connected with Massive APIs24 May
Other references · 6
- 2020MPNet: Masked and Permuted Pre-training for Language Understandingcited by 973
- 2025TRAIL: Trace Reasoning and Agentic Issue Localizationcited by 98
- 2024CodeRAG-Bench: Can Retrieval Augment Code Generation?cited by 89
- 2025Empowering LLMs with Logical Reasoning: A Comprehensive Surveycited by 51
- 2024Tools Fail: Detecting Silent Errors in Faulty Toolscited by 23
- 2023RAPGen: An Approach for Fixing Code Inefficiencies in Zero-Shotcited by 14
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2026ToolMisuseBench: An Offline Deterministic Benchmark for Tool Misuse and Recovery in Agentic Systems
- 2026ToolRobustBench: Stage-Wise Perturbation Evaluation and Failure Diagnosis for Tool-Calling Agents
- 2026Robust and Efficient Tool Orchestration via Layered Execution Structures with Reflective Correction
- 2026Tool-Schema Compression Enables Agentic RAG Under Constrained Context Budgets
- 2026The Bitter Lesson of Tool Calling
- 2026SchemaRouter: Field-Aware Tool Routing for Efficient Heterogeneous Agentic RAG
- 2026Beyond Function Calling: Benchmarking Tool-Using Agents under Tool-Environment Unreliability
- 2025A Framework for Testing and Adapting REST APIs as LLM Tools