Beyond Static Endpoints: Tool Programs as an Interface for Flexible Agentic Web Services
Abstract
In the agentic web era, LLM-based agents increasingly invoke web services as tools, yet most interfaces remain static endpoints that poorly express long-horizon workflows with loops, conditionals, joins, and retries. We present ToolPro, which represents an agent's tool intent as an executable tool program that compactly encodes multi-step service interactions with explicit effect types. ToolPro combines constraint-guided program construction, effect-aware replay for exactly-once state-modifying calls, and a profile-driven policy that decides when program execution outperforms stepwise calling. We instantiate ToolPro over MCP-style services with WebAssembly sandboxing and evaluate it on diverse workflows of real-world applications. ToolPro reduces end-to-end latency by up to 53.4% and client-side traffic by up to 96.1%, with larger gains under higher network latency and workflow complexity.
Lay Summary
LLM-based agents increasingly use online services to fetch information, update records, or manage files. Today they usually have to talk to these services one small request at a time, which is slow and can become unreliable when a task needs several steps, decisions, or retries. This paper introduces ToolPro, a way for an agent to send a whole task as a short program that the service can run safely on its side. ToolPro checks and repairs these programs when needed, keeps track of actions that change data so they are not accidentally repeated, and chooses this approach only when it is expected to be efficient. We measured ToolPro on real web applications and multi-step tasks. The results show that it can finish tasks faster and send much less data, especially when the network is slow or the task has many steps. This work points toward web services that are easier and safer for agents to use.