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

Manuscript Offprint

arXiv:2609.09395

The Menu Is an Execution Prior: State-Path Tool Menus for Online Agents

Bo Yan, Weikai Lin, Song Wang

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

Abstract

Language models act through tools, yet practical agents face libraries containing thousands of interfaces. We introduce the tool menu as the short, ordered subset of available tools shown to an agent before execution. The agent can call only tools in this menu. Multi-step tasks require the final action and the prerequisite tools that create its inputs in a usable order. Current constructors rank tools by request relevance, which can surface the final action while omitting or delaying less obvious producers. We introduce the state path, a pre-execution route from the observable request state to the desired outcome, and propose State-Path Tool Menu to learn it. Our framework treats the menu as an execution prior over these routes. Its encoder represents which tools can run from the current state, how their outputs satisfy later inputs, and which orders recur in training paths. A retriever covers an executable entry, the missing-input producers, and the final action. A reranker then places producers before consumers. On ToolBench, our menu raises online success from 0.737 to 0.898 and outperforms retrieval, reranking, generation, and routing baselines without changing the agent. The State-Path menu also covers more complete chains with 32 tools than the official list covers with 128, and its success gain persists across executor families with different model capacities.

1 Introduction

Language models become agents by translating instructions into external actions (Schick et al., 2023; Yao et al., 2023). At each step, an agent selects a tool and uses its observation to choose the next action. This loop becomes difficult as the action space grows. ToolBench, for example, exposes more than 16,000 APIs (Qin et al., 2024). Practical systems therefore retrieve a small candidate set before execution (Patil et al., 2024; Trivedi et al., 2024). We introduce the term tool menu for this request-specific, ordered interface. It fixes the selected interfaces and their displayed order for the full execution while preserving the agent, its online execution loop, and the original call budget.

Most menu constructors rank tools by request relevance (Shi et al., 2025; Qu et al., 2024; Zheng et al., 2024). Figure 1 shows why relevance alone fails on multi-step tasks. The left panel ranks SENDEMAILRECEIPT first before its receipt and address inputs exist. The middle panel restores its prerequisite calls in executable order. The right panel shows the resulting gain with the agent and 32-tool budget fixed. The conflict is individual relevance against route completeness (He et al., 2026; Liang et al., 2026). This gap motivates a route-level construction objective for the bounded menu.

We therefore propose the state path, a route through tool-induced states before execution. It starts from visible fields, crosses tools that produce missing inputs, and ends at the requested outcome. Individual relevance cannot express whether these calls form a complete route. The state path makes this route explicit and turns the menu into an execution prior before the first call.

To learn these paths, we propose State-Path Tool Menu with an encoder, a retriever, and a reranker. The encoder learns relation-aware tool representations from the request state, tool schemas, and training paths. The retriever uses these representations to select 32 tools with complementary path roles. The reranker turns the selected set into producer-before-consumer order. While acting on the resulting menu, the online agent keeps its original execution loop and call budget.

Our contributions are threefold:

• We formulate the bounded, ordered tool menu as an execution prior and identify state-path completeness as the missing objective in

∗^{*}Corresponding author.

Figure

Figure 1: A relevance menu can expose the destination without a runnable route. For a receipt request, the answer-facing tool matches the text but depends on earlier tools that retrieve the order, create the receipt, and recover the recipient address. State-Path Tool Menu uses the same menu budget to expose this route in executable order. The online agent and call budget remain unchanged.

relevance-based construction.

• We introduce State-Path Tool Menu, which jointly represents state compatibility, covers complementary path roles, and orders producers before consumers without changing the online agent or its call budget.

• We show that State-Path improves end-task success, complete-chain coverage, and executable entry across tool libraries, evaluators, and executor families. Paired outcomes and controlled variants connect these gains to route coverage and order within the same menu budget.