In-N-Out: A Parameter-Level API Graph Dataset for Tool Agents

Seungkyu Lee, Nalim Kim, Yohan JoarXiv 2025 · DOI

Abstract

Large Language Models (LLMs) acting as tool agents often struggle with multi-step tasks due to "parameter-level dependency"—the requirement to correctly map outputs from one API to inputs of another. This paper introduces In-N-Out, the first expert-annotated dataset of parameter-level API graphs. By explicitly mapping these dependencies, the researchers demonstrate significant performance gains in tool retrieval and multi-tool query generation, nearly doubling agent accuracy compared to using raw documentation alone.

Introduction: The Challenge of Multi-Tool Chaining

While LLMs are increasingly deployed as agents to perform real-world tasks—such as booking flights or managing digital assets—they frequently fail when a task requires a sequence of API calls. This is known as a multi-tool query.

The core challenge lies in parameter-level dependency. For instance, to follow an artist on a streaming service, an agent might first need to call a login API to retrieve an access_token and a search API to find the specific artist_id. If the agent cannot precisely identify which output connects to which input, the sequence fails. Standard API documentation is often noisy or lacks explicit connection information, leading LLMs to hallucinate parameters or plan invalid sequences.

Overview of API Graphs for Tool Retrieval and Query Generation

Methodology: Constructing the In-N-Out Dataset

The authors propose a shift from relying on ambiguous text documentation to using structured API graphs. To build the In-N-Out dataset, they developed a rigorous multi-stage pipeline designed to identify and verify functional connections between APIs.

The multi-stage pipeline for dataset creation, including documentation refinement, filtering, and human annotation
  1. Documentation Refinement: Using GPT-4o mini, complex JSON structures were flattened into primitive types (strings, integers, etc.) with concise parameter descriptions.
  2. Candidate Pair Filtering: To manage the exponential number of possible connections, a three-tier filter was applied:
  3. Rule-based: Eliminated type mismatches and incompatible domains (e.g., preventing a weather API from connecting to a financial tool).
  4. Semantic: Used SBERT embeddings to identify parameters with similar conceptual meanings.
  5. Context-aware: Employed an LLM to score the functional relevance of potential connections.
  6. Human Annotation: Expert developers reviewed the filtered pairs, labeling them as Strong-Edge (natural and compatible), Weak-Edge (conditional), or Non-Edge.

Dataset Composition

The In-N-Out dataset was constructed using two primary sources:

  • AppWorld: A simulated environment featuring 457 APIs across 9 applications (e.g., Amazon, Venmo, Gmail).
  • NESTful: A collection of 93 real-world APIs spanning 15 domains (e.g., Weather, News, Finance).

The resulting dataset contains over 30,000 parameter-level edges across 550 APIs, providing a dense map of data flow between disparate tools.

Key Insights and Experimental Results

  • Overcoming the Cross-Domain Bottleneck: Agents typically perform well within a single domain but fail when crossing domains (e.g., using a contact's email from a Phone API to send a message via Gmail). Explicit graphs are most valuable for these complex transitions.
  • Generalization Capabilities: Models fine-tuned on NESTful performed remarkably well on AppWorld, suggesting that agents can learn the underlying logic of software parameter relationships rather than just memorizing specific APIs.
  • Closing the Performance Gap: Automatically generated graphs (created by fine-tuned models) closed 90% of the performance gap between raw documentation and human-verified "gold" graphs.

Quantitative Performance

  • Tool Retrieval: Using In-N-Out graphs improved Top-1 accuracy for identifying prerequisite APIs from 43.3% to 84.3% on the NESTful dataset.
  • Query Generation: In complex 5-API chain tasks, the precision of LLM-generated plans increased from 5.6% to 30.6% in the AppWorld environment when guided by the graph.
  • End-to-End Success: On the $\tau$-bench benchmark, incorporating automated graph information increased task success rates by up to 10% for state-of-the-art models like GPT-4o.

Conclusion and Future Work

While the In-N-Out dataset significantly advances tool agent capabilities, limitations remain regarding the subjectivity of "natural" API calls and the manual effort required for gold-standard annotations. Future research may focus on dynamic graphs that update based on real-time execution results. By providing a structured map of the API landscape, In-N-Out moves the field closer to agents that truly understand the plumbing of the digital world.

Summary updated

BibTeX
@misc{lee2025n,
  author = {Seungkyu Lee and Nalim Kim and Yohan Jo},
  title = {{In-N-Out: A Parameter-Level API Graph Dataset for Tool Agents}},
  year = {2025},
  eprint = {2509.01560},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2509.01560},
}
Figure