SWE-agent and OpenHands runs in real containers and repositories
Explicit tool calls only. Shell wrappers such as execute_bash are excluded
Low
Runs from synthetic environments
Only calls whose tool names and schemas match real tools
The three source groups.
The corpus
The three groups merge into M_open.
All tool calls form M = M_MCP joined with M_open.
Calls within a run keep their order.
4.1.2 Tool-space graph modeling
The authors organize M into a typed tool-composition graph.
It can chain different services into one tool world (Figure 2).
Nodes
Each tool call gets a node.
A node holds the tool name, input schema, output schema and the normalized argument setup.
The same tool with different argument setups forms different nodes.
They may give different outputs and downstream links.
Relations
For adjacent calls in a run, three edge types come from fixed rules.
No LLM judgment is used.
Edge
Rule
Data dependency
The next input uses a value from the last output, and field types match
State dependency
The first call changes an object. The second reads or changes the same object
Retry dependency
The first call errors. The run switches tools. The next call succeeds
The three edge types.
Retry errors are kept as recoverable observations together with the successful retry. The edge set is the union of the three types.
Weights
Edge weight w(i, j) = N_ij / N_i.
N_i counts how often node i occurs.
N_ij counts how often node j follows node i.
Low-frequency edges are removed.
For data edges, the next arguments must trace to the earlier output.
That blocks false links from common constants such as limit=10.
So the graph captures transitions that happen in execution, not just a list of tools.
4.1.3 Agent environment data synthesis
Data is made only when an environment depends on persistent state.
The weighted undirected graph is clustered by connection density.
Clusters follow real MCP service tool setups.
This gives K = 804 clusters, each an environment with tools and a database.
Type
Example
What ToolSpace does
Operation
Tools that create, change or delete objects
Needs a database. A research agent collects and aligns web data, then expands it. Kept after unit tests and state-transition checks
State-query
google_drive.files.list, gmail.users.messages.get
Uses the outputs as anchors for the initial snapshot s_0. No database from scratch
Stateless
Web search, fixed-index lookup
Replays cached results from M. No live calls, no database
Three environment cases.
Result
Operation and state-query types enter the executable environment system.
Stateless environments use cached results.
This lowers synthesis and API cost and speeds up later trajectory synthesis.
Algorithm 1: ToolSpace
Build the graph from adjacent calls. Prune untraceable or low-weight edges.
Cluster into environments.
Make data on demand for operation environments. Restore s_0 for state-query. Cache returns for stateless.
For each walk attempt: start at a node bound to a database and s_0.
Sample an admissible neighbor with Eq. 3. Run it. Update the state.
If execution fails or breaks the edge relation, restore the earlier state and resample (rollback).
If length L and K environments are reached, record the walk with its snapshots.
For each walk.
Write a task with no tool names or order, and assertions from three sets.
Replay from s_0. If all assertions pass, add the sample.
Deduplicate. Make teacher trajectories for kept tasks and keep those passing V.
A state-aware walk with rollbackFrom Section 4.2.1 and Figure 3
Start at node with state s0
Keep only admissible neighbors
Pick next tool by weight
Run it for real, update state
Failure: restore and resample
Length L and K services reached
A demo walk made 28 tool calls across 6 environments after 2 rollbacks.
4.2.1 State-aware random walks
A walk starts at a tool node tied to a database and snapshot s_0.
The inputs are the number of environments K and the chain length L.
Graph walk
A neighbor is kept only if its next inputs can be filled.
They come from earlier returns or the current snapshot.
That means dependency reachability, state preconditions and parameter provenance.
Among kept neighbors, sampling follows edge weight.
P(next = v) is w(current.
V) divided by the sum of w(current, u) over admissible u.
Links seen more often in real traces are more likely to be extended.
The walk ends when it reaches length L and tools cover K environments.
Rollback sampling
If a chosen tool fails.
Or the new state does not match the data or state relation of the edge.
The step is dropped.
The environment goes back to the earlier state, and another neighbor is sampled.
Chains that still cannot proceed after repeated rollbacks are discarded.
Each kept walk carries s_0 and snapshots s_1 to s_L.
Each kept chain is replayed from s_0 against the recorded snapshots.
This checks state continuity and that every tool still runs.
4.2.2 Reverse verifiable task synthesis
A language model writes a task from each chain and its state changes.
The task has no tool names and no call order.
There is no reference answer.
Instead, each chain gets a verification set V with three parts.
V_state checks the final state.
V_trace checks key intermediate snapshots.
V_out checks fields that must appear in returned results.
A sample stays only if re-running from s_0 passes all checks.
Difficulty is raised through L, the target K and the share of cross-environment edges.
The data set holds (task, verification script, tool chain, snapshot).
Figures 4 and 5 show static statistics of the graph, environments and tasks.
(A) Graph scale and dependency structure
The graph has 77,760 tool-call-pattern nodes from 2,042 canonical tools.
Mean and maximum out-degree are 2.3 and 56.
The word cloud of environments includes Gmail, Google Sheets, Slack, Google Drive, Salesforce and Airtable.
Edge type
Share
Data
69%
State
25%
Retry
6%
Figure 4d: shares of edge types.
Data edges dominate, so composition is driven mostly by passing intermediate results. State and retry edges capture state prerequisites and failure recovery. Every edge is seen in adjacent calls in real runs.
(B) Environment diversity and selective grounding
The reference inventory covers 804 real MCP environments.
The largest domains.
Communication & General Utilities (27.4%), Finance & Markets (11.2%), Document & Design (10.1%).
Mean matched tools per environment is 10.86. The maximum is 436.
Tools such as web search, file reading and email sending exist in many environments.
453 tools (22.2%) are operational and 1,589 (77.8%) are not.
The largest operational category is structured record mutation, with 95 tools.
Of 804 environments, 181 (22.5%) are operational and 623 (77.5%) are not.
The largest operational environment category is document persistence, with 42.
An environment is operational if it has a tool that can change its state.
So stateless environments dominate the real world.
ToolSpace makes databases only for operational workspaces.
Restores snapshots for state-query tools and reuses cached returns for stateless ones.
(C) Task scale and complexity
ToolSpace makes 34,376 trajectories in total.
Figure 5 covers the 21,385 with at least five tool calls.
Mean and maximum length are 30,466 and 855,386 tokens.
Mean tool calls per trajectory are 18.86. The maximum is 209.
Mean environments per trajectory are 2.29. The maximum is 22.
At least 66.2% of trajectories involve two or more environments.
Chains are sampled by walks, run step by step and kept only after replay checks.
So tasks need long tool orchestration and consistent state.
The authors anchor the pipeline to AutomationBench and tau3-Bench Banking.
The goal is more cross-environment and long-horizon difficulty.
Benchmark construction
For a benchmark b with its own environment, collect its real tool calls.
Build a tool graph by the rules of Section 4.1.2.
Link in tools outside the benchmark that share data or state relations with benchmark tools.
This expands one environment into a cross-environment cluster.
Restore or make the needed databases and snapshots.
Walk with larger L and K than the original, and reverse-generate tasks and checks.
After replay and deduplication: AutomationBench Pro (300 tasks) and tau3-Bench Banking Pro (98 tasks).
Three doctoral-level experts reviewed all candidate tasks and checks over two days.
Only tasks approved by at least two experts stayed.
Agreement was strong: Fleiss' kappa 0.82, observed agreement 93.1%.
Data statistics (Figure 6)
Pro tasks need far more tool calls than the standard splits.
On AutomationBench, average calls rise for every model.
From 26.8 to 43.6 under Standard to 56.3 to 60.6 under Pro.
On tau3-Bench Banking, calls rise from 23.1 to 32.2 up to 27.3 to 36.3.
So the added difficulty comes from longer, more frequent tool orchestration.
Benchmarks
Seven long-horizon tool-use benchmarks.
AutomationBench: workflow automation.
SkillsBench: skill composition.
JobBench: job-style professional tasks.
tau3-Bench Banking: banking tool and dialogue.
BFCL V4: function calling.
Harvey LAB: legal agent workflows.
OfficeQA Pro: office document question answering.
Baselines
Four groups of models.
(i) Proprietary: Claude Opus 5 and GPT 5.6 Sol.
(ii) Open-weight above 200B: GLM 5.3, GLM 5.2, DeepSeek-V4-Pro-0813, Kimi K3, Qwen 3.8 Max.
(iii) 7 to 8B environment-scaling models: EnvScaler-8B, AWM-8B, Simulator-8B, Agent-World-8B, Agent-Reflex-8B and the Qwen3-8B backbone.