Papers
Topics
Authors
Recent
Search
2000 character limit reached

Beyond Static Endpoints: Tool Programs as an Interface for Flexible Agentic Web Services

Published 18 Jun 2026 in cs.SE and cs.AI | (2606.19992v1)

Abstract: In the agentic web era, LLM-based agents increasingly invoke web services as tools, yet most interfaces remain \emph{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 \emph{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.

Authors (4)

Summary

  • The paper presents ToolPro, a framework that encapsulates agentic intent as effect-typed, executable tool programs for robust and efficient web service orchestration.
  • It integrates constraint-guided construction, effect-aware replay, and profile-driven consolidation to ensure exactly-once semantics and achieve latency reductions of up to 53.4%.
  • ToolPro minimizes client-server traffic by up to 96.1% and dynamically adapts to workflow complexity and network conditions, enabling reliable multi-service chaining.

Tool Programs as an Interface for Flexible Agentic Web Services: An Expert Overview

Motivation and Problem Landscape

LLM-based agents increasingly perform complex procedural workflows over APIs, yet current web-service interfaces are limited to static, atomic endpoints designed for single-shot queries rather than compositional, multi-step operations. This endpoint-centric paradigm systematically inflates both network roundtrips and intermediate reasoning steps when expressing tasks with control flow, conditionals, joins, and retries, fragmenting coherent agentic intent into brittle, stateful sequences. This not only amplifies latency and induces data overfetching/underfetching but also makes recovery from partial failures error-prone due to duplicated or lost side effects. Figure 1

Figure 1: Static endpoints fragment multi-step agent intent into repetitive calls; ToolPro expresses the intent as an explicit, reusable tool program for service-side execution and reliable repair.

ToolPro: Architecture and Mechanisms

ToolPro redefines the agent–service boundary by introducing tool programs—effect-typed, executable representations of agentic intent—as first-class interface objects. Instead of orchestrating endpoint calls in a stepwise, externally-mediated loop, the agent delegates the entire procedural intent as a program, enabling the service to perform compilation, effect-typed mediation, execution, and repair centrally. This representational shift unlocks efficient control flow, explicit intent boundaries, and robust effect management.

The ToolPro runtime orchestrates three primary mechanisms to operationalize this interface safely and efficiently: Figure 2

Figure 2: ToolPro integrates constraint-guided construction, effect-aware replay, and profile-driven consolidation.

  1. Constraint-Guided Construction: ToolPro combines static interface checks and deterministic projection to map LLM-generated candidate programs into a rigorously typed, constrained program surface, expressible in Rust and compiled into WebAssembly (Wasm). This step rejects misaligned programs early and ensures that only effect-typed, control-flow-constrained programs are executed.
  2. Effect-Aware Replay for Exactly-Once Semantics: The runtime mediates all service-side calls, differentiating between idempotent READs and state-mutating WRITEs via explicit effect annotations. For WRITEs, ToolPro enforces exactly-once semantics across repair-driven re-executions using an ordered log replay protocol, preventing state duplication and silent corruption.
  3. Profile-Driven Consolidation Policy: ToolPro only consolidates workflows into tool programs if the predicted end-to-end cost (including synthesis, compilation, execution, and network RTT) is favorable compared to stepwise execution. It employs online profiling to adaptively select program execution or fallback to endpoint sequences, optimizing for workload size and network conditions.

Implementation Substrate

ToolPro is instantiated atop MCP-style web services, using Rust as the interface program language, projected into Wasm for strong sandboxing and side-effect mediation. All external interactions are routed through a unified, host-mediated call stub, enabling portable deployment, zero ambient authority, and comprehensive logging for replay and repair. The Wasm-based execution pipeline ensures that untrusted, LLM-generated code can be safely executed, inspected, and repaired within strict boundaries. Figure 3

Figure 3: Compilation of LLM-generated Rust tool programs to Wasm modules enables secure and efficient server-side execution with effect mediation.

Experimental Results

Latency and Traffic Efficiency

Evaluation across three representative real-world applications (Memos, Directus, MinIO) and multiple synthetic and realistic procedural workflows demonstrates that ToolPro yields substantial efficiency gains. In canonical NN-step workflows, ToolPro achieves end-to-end latency reductions of up to 53.4% (notably: 52.68s to 24.54s on complex cross-service tasks), driven by consolidating multi-step interactions into a single execution and eliminating repeated planning and roundtripping. Figure 4

Figure 4: ToolPro consistently reduces end-to-end latency, client-server communication, and LLM inference latency across diverse workflows and applications.

ToolPro also realizes dramatic traffic reductions at the client boundary, cutting client-side byte volume by up to 96.1%, especially in agentic tasks requiring repeated context transmissions in stepwise baselines. Figure 5

Figure 5: Client-side traffic volume drops precipitously under ToolPro, attributed to compact program transmission and minimized client-LLM communication.

Sensitivity to Network Conditions and Workflow Complexity

ToolPro's gains scale with both network RTT and workflow length. As RTT increases, the efficiency advantage over stepwise endpoints grows, since the amortized cost of tool program generation is dominated by the turn reductions (Figure 6). With increasing workflow complexity (N=5N=5 to N=20N=20), ToolPro's one-shot program execution remains stable in both latency and traffic, whereas stepwise interaction scales linearly in both metrics (Figures 6 and 7). Figure 6

Figure 6: ToolPro gains increase with higher RTT, as the policy more frequently selects program execution.

Figure 7

Figure 7: Workflow complexity analysis shows ToolPro maintains flat latency as NN increases, while baselines scale linearly.

Figure 8

Figure 8: Client-side traffic grows with workflow complexity in stepwise mode but remains minimal under ToolPro.

Reliability and Model Dependence

ToolPro's practical reliability is strongly tied to the code synthesis capability of the underlying LLM. State-of-the-art models such as gpt-5.1 and gemini-3-flash-preview achieve near-100% compilation success on challenging multi-service workflows, whereas less capable models introduce repair fallback. Importantly, the effect-aware replay mechanism robustly prevents state anomalies under iterative repair, failing closed to stepwise execution if semantic equivalence cannot be guaranteed.

Implications and Future Directions

ToolPro provides a rigorous foundation for agent-service interfaces in the agentic web era, aligning interface expressivity with real-world agentic needs and bridging the gap between statically defined endpoints and true, composable, procedural intent. Beyond immediate practical efficiency gains, this paradigm enables new forms of interface auditability, optimization, and introspection, and positions effect-typed program transmission as the right abstraction boundary for agentic tool use.

On the theoretical side, ToolPro delineates the requirements for effect safety, repair-driven re-execution, and policy adaptivity in LLM-agent architectures. Practically, the Wasm-based substrate can be applied to dynamic tool repository hosting, zero-trust agent deployment, or federated agentic environments. Given sufficient LLM code synthesis reliability and more expressive interface surfaces, ToolPro-like systems could underpin next-generation orchestration, robust multi-service chaining, and auditable automation frameworks.

Conclusion

ToolPro demonstrates that encapsulating agentic tool intent as effect-typed, executable programs achieves marked gains in efficiency, safety, and expressivity for web service orchestration. Supported by a practical enforceable contract and programmatic mediation on the service side, this architecture reduces end-to-end latency and client-agent traffic, especially as workflow complexity and network delays increase. ToolPro points toward a new agent–service interaction paradigm—one that is program-centric, effect-safe, and robust to failures and re-execution—establishing a credible blueprint for flexible agentic web interfaces.


Reference: "Beyond Static Endpoints: Tool Programs as an Interface for Flexible Agentic Web Services" (2606.19992)

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Collections

Sign up for free to add this paper to one or more collections.

Tweets

Sign up for free to view the 1 tweet with 4 likes about this paper.