Language models act through tools, yet real‑world agents must pick from libraries containing thousands of interfaces. We introduce the tool menu: a short, ordered subset of available tools shown to an agent before execution, and the agent may call only tools in this menu. Multi‑step tasks require prerequisite tools that generate inputs before the final action. Existing constructors rank tools by request relevance, often surfacing the final action while omitting or delaying less obvious producers. To address this we define a state path—a pre‑execution route from the observable request state to the desired outcome—and propose the State‑Path Tool Menu to learn such routes. Our framework treats the menu as an execution prior over these routes. The 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, the menu raises online success from 0.737 to 0.898 without changing the agent, outperforming retrieval, reranking, generation, and routing baselines. The State‑Path menu also covers more complete chains with 32 tools than the official list does with 128, and its gain persists across executor families of different model capacities. The code is released at GitHub.
Review