Scaling Tool-Centric Environment Synthesis
for Long-Horizon Agents

Guanting Dong*, Zhichao Sun*, Xinyu Yang*, Rui Wang, Xin Deng, Jiajie Jin, Zhixiong Yang, Junhao Huang, Han Han, Mingyu Ma, Xiaotao Wang, Yuyang Hu, Xiaoshuai Song, Xiaoxi Li, Jiejun Tan, Zhecan James Wang, Shihan Dou, Honglin Guo, Zhiheng Xi, Tao Gui†, Tao Ji, Qi Zhang, Yutao Zhu, Ji-Rong Wen, Zhicheng Dou†

Renmin University of China  ·  Fudan University
* Equal contribution  ·  † Corresponding authors

Scroll
In one minute · Method overview

ToolSpace is a tool-centric environment synthesis pipeline.

Rather than synthesizing a database first and deriving tools from it, ToolSpace starts from how real tools actually compose — and lets environments and tasks emerge from that structure, in two stages:

1

Tool Space Exploration

Mine data / state / retry dependencies from adjacent calls in real execution traces with deterministic rules, building the weighted tool-composition graph \(\mathcal{G}_{TS}\). Tightly-coupled tools are clustered into environments — a database is synthesized only for state-mutating clusters; query tools restore snapshots, stateless tools replay cached returns.

2

Cross-Environment Verifiable Task Synthesis

Run state-aware random walks with rollback over \(\mathcal{G}_{TS}\): sample state-compatible successors \(\propto w\), execute step by step, roll back and resample on failure. Each completed chain is decompiled into a natural-language task with assertion-based verification, and kept only if it replays from \(s_0\).

Performance 7-benchmark average
ToolSpace-744B-A40B+12.0
GLM-5.2  44.6 → 56.6
ToolSpace-35B-A3B+18.0
Qwen3.6-35B-A3B  23.0 → 41.0  ·  43.2 w/ RL
Cost 500 sampled environments
Synthesized files−55.3%
Data-centric  2,724 → 1,218  ·  −1,506 files
22.5% of environments need a database; the rest restore snapshots or replay cached returns.
Overview film

The framework and the results, in one pass.

A short walk through tool-centric synthesis — the two stages, then the performance and cost numbers on the same canvas.

1:02 · Demo
The idea

Reverse the order:
tools first, environments second.

Data-centric synthesis presumes a realistic environment and derives tool composition from it — reversing the dependency that governs real agent execution. That inversion causes three failures, and ToolSpace is built to remove each one.

Before · Data-Centric

Database → Tools → Tasks

Theme→Synthesize 𝒟→Derive tools ℱe→Derive tasks
  • Tool–functionality mismatch. Tools reverse-synthesized from a fabricated database diverge from real interfaces.
  • Inauthentic orchestration. Links come from random linking or shallow LLM judgment — never witnessed in execution.
  • Single-environment ceiling. Tools are locked in their own sandboxes; cross-environment reachability is undefined.
VS
ToolSpace · Tool-Centric

Traces → Tool Graph → Environments → Tasks

Real traces ℳ→𝒢TS witnessed edges→Cluster = env→Random-walk tasks
  • Real interfaces, preserved. Tool definitions come from real MCP servers & agent corpora; only operation envs get a synthesized 𝒟.
  • Execution-witnessed edges. Every edge was seen between adjacent real calls, typed & weighted by frequency.
  • Cross-environment by construction. Walks cross clusters along witnessed edges — complexity grows with the space, not one sandbox.
Method

Three stages, one primitive:
witnessed tool composition.

Every retained training sample is a walk that actually executed — step by step, under real state transitions — and replayed cleanly from its initial snapshot.

🛰️

Tool Space Exploration

Collect real MCP & web agent trajectories, then mine adjacent calls with deterministic rules — shared arguments become data edges, state preconditions become state edges, repeated-after-failure calls become retry edges. Cluster the weighted graph into environments; synthesize a database only for operation clusters, restore snapshots for state-query tools, replay cached returns for stateless ones.

𝒢TS = (𝒱, ℰ, w) · 69 / 25 / 6 edge mix
🎲

State-Aware Random Walks + Rollback

From a tool bound to \((𝒟_k, s_0)\), repeatedly sample a state-compatible successor proportionally to edge weight and execute it. Every argument must trace to the task, \(s_0\), or an earlier return. A failed or relation-violating step restores \(s_{t-1}\) and resamples — chains that cannot proceed are discarded.

P(vt+1=v ∣ vt) = w(vt,v) / Σu w(vt,u)
✅

Decompile, Verify, Replay

Each successful walk \(\omega\) is decompiled into a natural-language task \(q\) (no tool names, no call order) plus assertions over final state, intermediate snapshots, and required output fields. The sample enters \(\mathcal{X}_{TS}\) only if re-executing \(\omega\) from \(s_0\) passes every check.

V = Vstate ∪ Vtrace ∪ Vout · replay or discard
Data edge — output feeds input (69%) State edge — precondition on \(s_t\) (25%) Retry edge — recovery after failure (6%) Mean out-degree 2.3 · max 56 · 66.2% of trajectories span ≥ 2 service families
Interactive demo

Walk the Tool Space yourself.

A miniature, executable model of §3.2 — ten environments and 160 tools drawn as a star field. Design the walk on the left, watch a bright walker travel the witnessed edges in the middle, and follow its candidate probabilities, pseudocode and failures on the right.

Live · Random Walk on ToolSpace

ToolSpace Walk Observatory

t 0 / 16envs 0 / 4rollbacks 0state s₀
Main results

Seven benchmarks.
One training recipe, every scale.

Click any configuration to inspect it — the same leaderboard pattern as a benchmark site, because ToolSpace is also a benchmark-building machine. Averages are over AutomationBench, SkillsBench, JobBench, τ³-Bench Banking, BFCL V4, Harvey LAB and OfficeQA Pro.

ToolSpaceProprietaryOpen >200BOpen 27–35B
Pro benchmarks

The same pipeline, pointed at frontier benchmarks, makes them much harder.

Anchoring ToolSpace to the standard benchmarks — AutomationBench and τ³-Bench Banking — to build AutomationBench Pro and τ³-Bench Banking Pro links in outside tools that share witnessed relations, then walks with larger \(L\) and \(K\). Same protocol, same prompts — longer chains (26.8–43.6 → 56.3–60.6 tool calls on AutomationBench Pro) and real cross-environment breadth. Frontier models drop by up to 38.2 points.

AutomationBench Pro

300 tasks · seven frontier models · AutomationBench vs. AutomationBench Pro

τ³-Bench Banking Pro

98 tasks · seven frontier models · τ³-Bench Banking vs. τ³-Bench Banking Pro

Tool calls · AutomationBench vs. AutomationBench Pro

Average tool calls per task

AutomationBenchAutomationBench Pro

Tool calls · τ³-Bench Banking vs. τ³-Bench Banking Pro

Average tool calls per task

τ³-Bench Bankingτ³-Bench Banking Pro

Pro tasks are longer, not just harder to guess: on AutomationBench Pro every frontier model needs roughly 1.4 to 2.1× as many tool calls as on AutomationBench (26.8–43.6 → 56.3–60.6), and τ³-Bench Banking Pro also rises for every model over τ³-Bench Banking (23.1–32.2 → 27.3–36.3). Data read from the paper's tool-call comparison (Figure 6).

Scaling

More data helps.
More environments help more fundamentally.

Both scaling axes use the same Qwen3.6-35B-A3B backbone, training recipe and evaluation protocols — only the amount of ToolSpace data, or the number of environment clusters it is drawn from, changes. Zero denotes the untuned backbone. Lines below are read directly from the paper's scaling figure (five benchmarks).

(a) Data scaling

Training-data fraction · 0 → 1/16 → 1/8 → 1/4 → 1/2 → full

The full dataset is best on all five benchmarks, and the last doubling (1/2 → full) still adds +4.6 on AutomationBench — the current synthesis scale has not hit its returns ceiling. Each fraction adds newly witnessed tool chains, not more copies of the same ones.

(b) Environment scaling

Training-environment fraction · 0 → 1/16 → 1/8 → 1/4 → 1/2 → full

AutomationBench jumps 9.2 → 33.8 between 1/16 and 1/8 environments: new clusters contribute new cross-environment edges, so space breadth is the limiting factor at low coverage (≈ +4 pts per doubling beyond 1/8). τ³-Bench Banking, which relies on a narrower stateful tool set, gains most only at the full environment set (19.6 → 34.0).

Cite ToolSpace

@article{dong2026toolspace,
  title   = {ToolSpace: Scaling Tool-Centric Environment Synthesis
             for Long-Horizon Agents},
  author  = {Dong, Guanting and Sun, Zhichao and Yang, Xinyu and others},
  year    = {2026},
  note    = {Renmin University of China and Fudan University}
}
Open PDF ↗