arXiv(opens in a new tab)cs.SESep 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2609.01736

Harness Engineering in LLM Tool Use via Agent-Native Reusable Tool Primitives

Haibo Jin, Suijin Wang, Xucheng Yu, Haojing Luo, Haohan Wang

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Haibo Jin

School of Information Sciences

University of Illinois at Urbana-Champaign

Champaign, IL 61820

haibo@illinois.edu

Suijin Wang

Independent Researcher

Starc Institute

wangsuij22@gmail.com

Xucheng Yu

School of Information Sciences

University of Illinois at Urbana-Champaign

Champaign, IL 61820

xy63@illinois.edu

Haojing Luo

Independent Researcher

Starc Institute

haojingluo9104@gmail.com

Haohan Wang*

School of Information Sciences

University of Illinois Urbana-Champaign

Champaign, IL 61820

haohanw@illinois.edu

Abstract

Large language models (LLMs) augmented with external tools have demonstrated remarkable capability in solving complex real-world tasks. However, existing approaches suffer from two key challenges: brittle multi-step and multi-turn reasoning caused by incompatible tool output types and API schemas, and performance degradation under large tool catalogues. To address these, we introduce Tool Primitives, a design that replaces rigid API schema-based invocation with natural language as the interface for tool calling, where each tool is wrapped with an LLM interface that handles schema resolution and execution internally, enabling natural inter-tool communication for nested and multi-turn tool calling. Building on Tool Primitives, we host ToolFace, a centralized repository of 25,519 functions from which LLMs dynamically retrieve only the relevant tools at inference time, eliminating the need to enumerate raw API schemas in context. To orchestrate Tool Primitives and ToolFace reliably in complex settings, we further propose HEART, a Harness Engineering framework via Agent-native, Reusable Tool Primitives, comprising a Planner, Router, and Verifier that jointly support dynamic tool invocation planning, multi-step execution, and feedback-driven recovery.

Experiments on five benchmarks demonstrate that HEART outperforms SFT-based models by 10% on average and surpasses GPT-5.4, Claude-4.6-Sonnet, and Gemini-3.1-Pro by 6% on average while reducing API cost by up to 85%. On 50 real-world tasks, HEART achieves 84% task completion, 3.8× the average of three frontier commercial models (22%).

*Corresponding Author

Preprint.

1 Introduction

Large Language Models (LLMs) with external tools and APIs has significantly enhanced the capability to solve complex real-world tasks [1, 2]. To equip LLMs with tool-use capabilities, existing approaches broadly fall into two paradigms: training-free methods that elicit tool invocation through prompting and in-context demonstrations [3, 4], and fine-tuning-based methods that train models on curated tool-use trajectories via supervised fine-tuning (SFT) and preference optimization [5, 6, 7]. The latter have driven substantial improvements in structured function calling, with models increasingly evaluated on standardized benchmarks such as BFCLv4 [8].

Despite rapid progress, existing LLM tool-use methods remain brittle in complex multi-step and multi-turn reasoning. When tool invocations involve dependent steps, models often fail to correctly map outputs from one tool into the expected input schema of the next, since tools expose heterogeneous APIs and return diverse output formats. This issue becomes even more severe in multi-turn interactions, where relevant context progressively degrades as histories grow longer. Existing benchmarks confirm these limitations: on nested API call benchmarks such as NESTFUL [9], even the strongest models achieve only 28% full-sequence match accuracy, while on multi-turn benchmarks such as τ2\tau^2-Bench [10], performance drops substantially as interaction depth increases. This raises a natural question: instead of requiring models to speak the language of APIs, can tools be made to speak the language of models? We answer affirmatively with Tool Primitives, which replace rigid schema-based invocation with natural language interfaces for tool calling. Rather than requiring models to memorize exact parameter types and API schemas, each tool is wrapped with an LLM interface that handles schema resolution and execution internally. Models therefore interact with tools through natural language, making inter-tool communication more uniform and enabling nested tool calling and multi-turn information acquisition without explicit schema knowledge.

Second, a large tool catalogue degrades performance. Tool invocation is typically conditioned on a large catalogue of candidate tools provided in the input context; as the number of available tools grows, model performance degrades substantially. Recent evaluations show accuracy drops of 7%-85% as tool catalogue size scales from 8K to 120K tokens [11, 12], and this problem is further amplified in real-world settings such as ToolBench [2], which encompasses over 16,000 real-world APIs. Motivated by this, we argue that models need not know the full tool catalogue upfront and tools should instead be retrieved on demand at inference time. Inspired by Agent Skills [13] and Agent Primitives [14], both of which package instructions, metadata, and resources into modular reusable capability blocks, we treat tools analogously and introduce ToolFace, a large-scale tool repository containing 25,519 functions each paired with a structured schema and an executable implementation, where each function is further wrapped as a Tool Primitive to enable natural language interaction. When calling tools, LLMs dynamically search and retrieve only the relevant tools from ToolFace at inference time, directly avoiding the performance degradation caused by large tool catalogues.

To make Tool Primitives and ToolFace practical for real-world deployment, we introduce HEART, a Harness Engineering via Agent-native, Reusable Tool Primitive. We design a multi-agent system (MAS) comprising a Planner that decomposes user queries into an invocation plan (or requests clarification when context is insufficient) and a Router that performs parameter mapping to bind function arguments and hyperparameters according to user queries before dispatching calls to the corresponding Tool Primitives. Tool Primitives further execute the tools and return results. We also employ a Verifier that evaluates each execution result against four criteria: task completion, argument consistency, execution validity, and constraint satisfaction. When verification fails, feedback is returned to the Planner for re-planning, enabling iterative recovery instead of one-shot execution.

Extensive experiments on five benchmarks spanning large-scale real-world API invocation across single- and multi-tool scenarios (ToolBench [2]), nested API call sequences (NESTFUL [9]), dual-control conversational agent evaluation (τ2\tau^2-Bench [10]), robustness and fine-grained tool-use evaluation (ACEBench [15]) and agentic web search and memory function calling (BFCLv4 [8]), demonstrate that HEART consistently outperforms SFT-based models by 10% on average and surpasses three commercial models, including GPT-5.4, Claude-4.6-Sonnet, and Gemini-3.1-Pro, by 6% on average while reducing token cost by up to 85%. Furthermore, we curate 50 real-world tasks on which HEART achieves 84% task completion and demonstrates robustness against prompt injection attacks, reducing attack success rate to 0.0%. Our main contributions are as follows:

  • We design Tool Primitives, a natural language interface that encapsulates schema resolution and execution within each tool, enabling nested and multi-turn tool calling without requiring explicit API schema knowledge. We further introduce ToolFace, a repository of 25,519 functions wrapped as Tool Primitives, enabling dynamic tool retrieval at inference time.
  • We introduce HEART, a harness engineering framework for LLM tool use realized through a multi-agent system comprising a five-stage pipeline—Planning, Routing, Tools, Execution, and Verification—to jointly address key limitations of existing LLM tool-use approaches.
  • Experiments on five benchmarks show HEART outperforms SFT-based models by 10% and three commercial models by 6% on average, while reducing token cost by up to 85%. On 50 real-world tasks, HEART achieves 84% task completion, 3.8×3.8\times the average of three frontier commercial models (22%).

References (38)