LLM Agents Making Agent Tools

Georg Wölflein, Dyke Ferber, Daniel Truhn, Ognjen Arandjelovic, Jakob Nikolas Kather

Introduction

While Large Language Models (LLMs) have demonstrated remarkable proficiency in utilizing predefined tools—such as calculators, search engines, or basic APIs—their utility in specialized scientific domains remains constrained by the "toolset" provided by human developers. In fields like medicine, genomics, and pathology, there exists a vast "long tail" of highly specific software and models that are too niche for manual integration into LLM frameworks.

To bridge this gap, researchers have introduced TOOLMAKER, an agentic framework designed to autonomously create, debug, and deploy its own tools by interpreting scientific literature and associated GitHub repositories. By automating the entire lifecycle of tool creation—from environment configuration to functional implementation—TOOLMAKER enables LLMs to act as more capable "virtual scientists."

The TOOLMAKER Framework

TOOLMAKER operates as a dynamic extension of an AI research assistant. When a user provides a complex request that cannot be satisfied by existing tools in a library, the system triggers the TOOLMAKER pipeline to synthesize a new, reusable interface for the required software.

High-level workflow of the AI research assistant using TOOLMAKER.

The framework is structured into two primary phases: Environment Setup and Tool Implementation. The core challenge in scientific software is often "dependency hell"—the requirement for specific libraries, pre-trained weights, and OS-level configurations. TOOLMAKER addresses this by using an agent (powered by GPT-4o) to clone repositories, read documentation, and iteratively attempt installations within a Docker container, creating a reproducible "snapshot" of the working environment.

Iterative Implementation and Self-Correction

Once the environment is stabilized, the agent explores the codebase to understand the logic required for a specific task. The implementation process is not a simple "one-shot" generation but a sophisticated, closed-loop system involving multiple specialized agents.

Detailed TOOLMAKER architecture and iterative debugging process.

As illustrated in the detailed architecture, the process follows a rigorous path:

  1. Planning: The agent generates a step-by-step strategy based on the repository structure.
  2. Implementation: A Python function is written to execute the task (e.g., training a classification model using the STAMP framework).
  3. Execution and Assessment: The tool is run against an example invocation. If the output is unsuccessful or produces errors, a "Diagnose Error" agent analyzes the logs.
  4. Re-implementation: Based on the diagnosis, the agent fixes the code and tries again. This cycle continues—sometimes requiring up to 9 iterations—until the tool passes validation.

To handle the complex reasoning required for these steps, the system leverages high-reasoning models like OpenAI’s o1-mini.

Benchmarking with TM-BENCH

To evaluate TOOLMAKER, the authors developed TM-BENCH, a new benchmark consisting of 15 complex computational tasks across pathology, radiology, omics, and 3D vision. Unlike existing benchmarks like SWE-bench, which focus on bug fixing, TM-BENCH requires agents to build entirely new, reusable interfaces from scratch in open-ended environments. The benchmark includes over 100 unit tests to ensure that the generated tools produce correct data structures and values rather than merely "hallucinating" success.

Key Results and Insights

TOOLMAKER significantly outperformed existing state-of-the-art software engineering agents. On the TM-BENCH suite, TOOLMAKER achieved a success rate of 80% (12 out of 15 tasks), while OpenHands managed only 20% (3 out of 15).

Key findings from the study include:

  • Environment Persistence: The ability to "snapshot" a working environment was the primary differentiator between success and failure. Most baseline agents failed because they could not navigate complex installation requirements.
  • Cost Efficiency: The average cost to create a fully functional, debugged scientific tool was approximately $0.94 in API tokens, demonstrating the economic viability of autonomous tool synthesis.
  • Generalization: Tools created by TOOLMAKER passed unit tests using data different from the initial examples, proving the agent successfully captured the underlying library logic.

Limitations and Future Directions

While TOOLMAKER represents a major step forward, it is currently limited to in silico computational tasks and cannot perform physical laboratory experiments. Furthermore, the framework's success is partially dependent on the quality of the source repository's documentation.

The authors also highlight critical safety and ethical considerations. An autonomous system capable of implementing complex biochemical software could potentially be misused for the creation of harmful agents, necessitating the development of robust safety guardrails alongside the technology. Future work will focus on integrating these on-the-fly tools into larger autonomous research loops where agents can identify knowledge gaps, find relevant papers, and build the tools necessary to test new hypotheses.

Summary updated

BibTeX
@inproceedings{wolflein2025llm,
  author = {Georg Wölflein and Dyke Ferber and Daniel Truhn and Ognjen Arandjelovic and Jakob Nikolas Kather},
  title = {{LLM Agents Making Agent Tools}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2025},
}
Figure