Learning API Functionality from In-Context Demonstrations for Tool-based Agents
On the map: LLM agents and tool use → Tool learning and function calling
Abstract (arXiv)
Digital tool-based agents, powered by Large Language Models (LLMs), that invoke external Application Programming Interfaces (APIs) often rely on documentation to understand API functionality. However, such documentation is frequently missing, outdated, privatized, or inconsistent-hindering the development of reliable, general-purpose agents. In this work, we propose a new research direction: learning of API functionality directly from in-context demonstrations. This task is a new paradigm applicable in scenarios without documentation. Using API benchmarks, we collect demonstrations from both expert agents and from self-exploration. To understand what information demonstrations must convey for successful task completion, we extensively study how the number of demonstrations and the use of LLM-generated summaries and evaluations affect the task success rate of the API-based agent. Our experiments across 3 datasets and 6 models show that learning functionality from in-context demonstrations remains a non-trivial challenge, even for state-of-the-art LLMs. We find that providing explicit function calls and natural language critiques significantly improves the agent's task success rate due to more accurate parameter filling. We analyze failure modes, identify sources of error, and highlight key open challenges for future work in documentation-free, self-improving, API-based agents.
Key facts. Cited by 1 paper in the map (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 23 references that are in the map. First posted on arXiv 30 May 2025.
Builds on
11 of 23 references.
Closest ancestors · 2
Same direction, newest first
- 2024StableToolBench: Towards Stable Large-Scale Benchmarking on Tool Learning of Large Language Models12 Mar
- 2023ToolAlpaca: Generalized Tool Learning for Language Models with 3000 Simulated Cases8 Jun
Other references · 9
- 2023GPT-4 Technical Reportcited by 18,132
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
- 2024τ-bench: A Benchmark for Tool-Agent-User Interaction in Real-World Domainscited by 1,280
- 2024TheAgentCompany: Benchmarking LLM Agents on Consequential Real World Taskscited by 306
- 2024OfficeBench: Benchmarking Language Agents across Multiple Applications for Office Automationcited by 66
- 2025SynWorld: Virtual Scenario Synthesis for Agentic Action Knowledge Refinementcited by 9
- 2024FinVerse: An Autonomous Agent System for Versatile Financial Analysiscited by 5
- 2023APIDocBooster: An Extract-Then-Abstract Framework Leveraging Large Language Models for Augmenting API Documentationcited by 3
- 2025Multi Agent based Medical Assistant for Edge Devicescited by 2
Built on by
Citing papers per year: 2025: 1.
1 paper.
Similar, not cited
Close in wording, no citation either way
- 2026OpaqueToolsBench: Learning Nuances of Tool Behavior Through Interaction
- 2026Learning to Rewrite Tool Descriptions for Reliable LLM-Agent Tool Use
- 2026Diagnosing Knowledge Gaps in LLM Tool Use: An Agentic Benchmark for Novel API Acquisition
- 2025In-N-Out: A Parameter-Level API Graph Dataset for Tool Agents
- 2026The Evolution of Tool Use in LLM Agents: From Single-Tool Call to Multi-Tool Orchestration
- 2025A Framework for Testing and Adapting REST APIs as LLM Tools
- 2026Beyond Perfect APIs: A Comprehensive Evaluation of LLM Agents Under Real-World API Complexity
- 2025ALLOY: Generating Reusable Agent Workflows from User Demonstration