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 are still exposed as \emph{static endpoints}. As tasks grow into long-horizon workflows with loops, conditionals, joins, and retries, agents must externalize control flow into stepwise calls and multi-round reasoning, causing excessive network turns, over-/under-fetching, and brittle recovery under partial failures. We argue that the bottleneck is representational: endpoint sequences are a poor interface for expressing tool intent. We present ToolPro, which represents an agent’s tool intent as an \emph{executable tool program}---a composable program that compactly encodes multi-step service interactions with explicit effect types. ToolPro combines (i) constraint-guided program construction with compiler/runtime feedback to improve executability of LLM-produced code, (ii) effect-aware replay that provides exactly-once semantics for state-modifying calls across iterative repair and re-execution, and (iii) a profile-driven consolidation policy that decides when program execution outperforms stepwise calling. We instantiate ToolPro over MCP-style services with WebAssembly sandboxing. Across three real applications and six workflows, ToolPro reduces end-to-end latency by up to 37.2\% and client-side traffic by up to 85.3\%, with larger gains under higher network latency and increased workflow complexity. We believe that ToolPro lays a foundation for agent-facing service interfaces in the emerging agentic web.