Manuscript Offprint

arXiv:2610.25563

Learning Which Device to Call: Online Tool Grounding for LLM Agents in IoT

Yichen Liu, Xiaochong Jiang, Haoran Yu, Lifei Liu

Yichen Liu 1^{1}, Xiaochong Jiang 2^{2}, Haoran Yu 1^{1}, Lifei Liu 1^{1}

1^{1}Independent Researcher, Seattle, WA, USA 2^{2}Independent Researcher, Boston, MA, USA

Email: yil160@ucsd.edu, jiang.xiaoc@northeastern.edu, haoranyu889@gmail.com, lliu.lifei@gmail.com

Abstract—The Internet of Things (IoT) gives large language model (LLM) agents access to physical observations, but one requested capability is usually offered by several devices, and the agent's plan does not say which one to call. Existing work retrieves relevant tools and checks plan feasibility, without learning which eligible device returns a useful observation. Unlike previous works, we study online tool grounding: binding an already specified tool call to one physical endpoint under service cost and device participation constraints. We propose a framework that learns which physical device should execute each agent-issued call. It formulates selection as a contextual bandit problem and combines adaptive context partitions with hierarchical endpoint trees, so that execution feedback is reused across related requests and devices. Selection balances task success against service cost while respecting device capability, authorization, battery reserves, and availability. Gaussian reward aggregation provides an optional mechanism for protecting individual feedback values. Theoretical results establish a finite-horizon regret bound and differential privacy for released reward statistics under fixed, reward-independent assignments. In a simulated loading-dock workload, the proposed router achieves higher step success and better cost-adjusted service, at lower simulated device energy and latency, than nearest-device, advertised-quality, UCB1, and LinUCB selection.

Index Terms—Agentic AI, Internet of Things, large language models, tool grounding, contextual bandits, differential privacy.

I. INTRODUCTION

Large language model (LLM) agents provide a way to interact with Internet of Things (IoT) systems through natural-language requests. By combining reasoning with tool calls, an agent can gather observations, assess the returned evidence, and determine its next action [1]. The agent, however, reasons about capabilities, whereas the deployment consists of individual devices.

Consider an agent asked whether a loading dock is blocked. The agent can issue capture_image(area), but this call does not identify a unique camera. A fixed camera and a robot-mounted camera may both cover the area, yet differ in viewing angle and image quality, so the system must choose which device to invoke. We call the assignment of an already specified tool call to one physical device endpoint device-bound tool grounding, and we refer to each device-capability pair as an endpoint.

Existing approaches address tool selection and physical feasibility from complementary directions: retrieval methods match requests to tool descriptions and adapt from interaction feedback [2], while spatial and resource-aware planners verify that a sensing plan is executable [3]. However, three problems remain. First, identifying a relevant capability or a feasible plan does not determine which eligible endpoint will deliver the most useful observation. A high-resolution camera may have an obstructed view, whereas a camera with lower resolution may provide sufficient evidence from a clearer angle [4], [5], and sensor outputs also degrade with device faults and operating conditions [6]. Usefulness is therefore a property of the request-endpoint pair and has to be learned from execution outcomes. Because only the selected device produces feedback, the router must balance using established endpoints against exploring alternatives.

Second, the choice must reflect the devices’ current operating conditions. A mobile camera may move out of range, a battery-powered device may lack sufficient energy, and even a useful observation may arrive too late for the deadline. Selecting devices solely by past success therefore cannot ensure that the next call is feasible, and it depletes the reserves of the endpoints it favors.

Third, the execution history used to improve these decisions is itself sensitive. A sequence of feedback records describes when a particular device at a particular location was called and how it responded, which reveals activity patterns of the monitored space. Releasing individual rewards or unprotected aggregates, for example to an operator dashboard, therefore discloses more than routing requires, and the learning process needs a disclosure-limiting mechanism with a defined scope.

To address these challenges, we propose an online tool-grounding framework for LLM agents in connected IoT systems. We formulate each routing decision as a contextual bandit problem: the requested capability, target, quality requirements, and deadline define the context, and each eligible endpoint represents a candidate arm. The router checks compatibility, authorization, and predicted feasibility, selects one endpoint, and updates its utility estimate from a reward that combines task success with latency and energy cost. The LLM remains fixed: it chooses the operation and its target, and the router chooses the device.

The proposed learner uses adaptive context partitions and hierarchical endpoint trees to organize this experience. Context cells group requests with similar requirements, while the endpoint tree of each cell groups devices by their operating features, so that nearby request-endpoint pairs can share feedback under the stated smoothness assumptions. Refinement creates finer partitions as evidence accumulates. For privacy preservation, an optional Gaussian mechanism perturbs temporal-tree reward aggregates [7]. The guarantee protects individual reward values in released statistics when metadata, record assignments, and release schedules are fixed independently of rewards, and it does not extend to the complete adaptive routing interaction.

The contribution of this paper lies in the device-bound tool-grounding setting and its formulation, not in new partition or aggregation components. The context and endpoint partitions follow the two-sided structure of [40], and the private aggregation follows tree-based private learning and Gaussian summation [7], [37]. What is new is how these parts are combined for agent tool calls: eligibility is checked as a hard constraint before learning, the reward comes from verified tool-step outcomes and service cost, and the privacy statement names exactly which released statistics it covers.

References (42)