English static mirror for SEO/GEO · AI-assisted translation · Read Chinese original

HyperTool: Evolving AI Agents from One-at-a-Time Tool Calls to Batch Scripting

Forum topic · ✨步子哥 · 2026-06-12

Summary

Researchers from Shanghai Jiao Tong University and IQuest Research propose HyperTool, a framework that upgrades AI agent tool use from sequential, one-call-at-a-time MCP invocations to writing code blocks that batch multiple tool calls. The core insight is an 'execution granularity mismatch': task-level operations require several low-level steps whose intermediate outputs bloat the context window and fragment reasoning. With HyperTool, the model writes a code block that calls existing MCP tools, stores and filters intermediate values, and returns only the final result, remaining a strict superset of standard interfaces. A data synthesis pipeline builds compositional tasks, generates verifiable trajectories with GLM-5.1, and validates execution in real MCP environments. On MCP-Universe, Qwen3-32B improves from 15.69% to 35.29% average accuracy and Qwen3-8B from 9.93% to 33.33%, with the 8B model outperforming GPT-OSS (32.13%) and Gemini-2.5-Flash (25.58%). Gains are largest on composition-heavy tasks such as financial analysis. Ablations show a uniform HyperTool-only interface beats a hybrid mode by 6.5 points, and the approach completes more underlying tool calls in fewer interaction turns under a 128k context budget. Paper: https://arxiv.org/abs/2606.13663

Imagine working with files on a command line. Every step requires manual input: open a folder, list files, find the target, copy the path, paste it into another command. If you need to do ten similar operations, you repeat twenty rounds of manual typing.

This is how current AI agents use tools: call one tool, wait for the result, then decide the next step. Even for a fully deterministic sequence (e.g., geocode two cities, then compute the distance between them), the agent must proceed step by step, stuffing every intermediate result into the context window, which keeps growing like a snowball.

A team from Shanghai Jiao Tong University and IQuest Research proposes HyperTool, upgrading agent tool use from "typing commands line by line" to "writing batch scripts."

The root problem: execution granularity mismatch

Current MCP-style tool interfaces have a fundamental design flaw: an execution granularity mismatch. A task-level operation ("find the distance between two cities") requires three low-level steps: geocode city A, geocode city B, compute the distance. But the agent's reasoning only needs the final result.

In step-by-step mode, these three steps become three model-visible state transitions. Geocoding outputs, intermediate coordinates, and the final result all surface in the main reasoning chain. This causes:

1. Context bloat: long tool outputs pile up in the reasoning chain even when only a few fields are useful. 2. Fragmented reasoning: the model is forced to alternate between high-level task reasoning and low-level data plumbing, like looking up a dictionary every few sentences while writing an essay.

HyperTool's core idea: fold subroutines into one call

HyperTool's approach is elegant: don't change the underlying tools, change how they're invoked.

Instead of calling atomic tools one by one, the model writes a code block. Inside, it can call existing MCP tools, store return values, parse and filter results, perform lightweight computation, and define temporary helper functions. All intermediate steps happen inside the block; only the final result returns to the main reasoning chain.

It's like evolving from an "interactive command line" to a "scripting language": you write a small program that runs automatically and reports only the result.

If the code block contains just one tool call, HyperTool degenerates to standard step-by-step mode, so it is fully backward compatible and a proper superset of existing interfaces.

Data synthesis: teaching the model to "write scripts"

Models aren't born knowing how to use HyperTool. The team designed a data synthesis pipeline:

1. Compositional task construction: generate tasks requiring cross-tool collaboration (e.g., "check weather + check flights + compare prices"). 2. Trajectory collection: use GLM-5.1 to generate HyperTool-format execution traces, including local repair (auto-fixing code errors) and context compression. 3. Trajectory verification: validate execution correctness and evidence consistency in real MCP environments.

Verification is the critical step: it's not about "looking right," but actually running in real environments to ensure the code blocks produce correct results.

Results: an 8B model surpasses GPT and Gemini

On the MCP-Universe benchmark, HyperTool delivers striking gains:

  • Qwen3-32B: average accuracy up from 15.69% to 35.29%, more than doubling
  • Qwen3-8B: from 9.93% to 33.33%, more than tripling
  • The 8B HyperTool even outperforms GPT-OSS (32.13%) and Gemini-2.5-Flash (25.58%)
The largest improvements come on composition-heavy tasks. In the finance domain, both 8B and 32B versions hit 62.5% accuracy, because these tasks most need cross-tool transfer of intermediate values and result filtering/aggregation, exactly what HyperTool code blocks excel at.

Ablations reveal a counterintuitive finding: a unified interface beats a hybrid one. HyperTool-only mode (all operations via code blocks) outperforms hybrid mode (atomic calls for simple operations, code blocks for complex ones) by 6.5 percentage points. A unified interface reduces the cognitive burden of switching between modes, just as you wouldn't switch back to a command line mid-script.

Token efficiency: fewer turns, more tool calls

HyperTool executes more underlying tool calls in fewer interaction turns. By folding multi-step deterministic operations into code blocks, it avoids the context bottleneck that truncates long ReAct trajectories. Under a budget of 50 tool calls and 128k context, HyperTool accomplishes more work with fewer turns.

Why this matters

HyperTool addresses not just efficiency but a fundamental design choice in agent architecture. All mainstream agent frameworks (ReAct, CodeAct, ToolFormer) assume "one tool call at a time" is naturally reasonable. HyperTool shows this assumption is suboptimal, just as nobody would argue an operating system should support only single-command execution.

From an engineering perspective, HyperTool's MCP compatibility means it can plug into existing agent systems out of the box. From a research perspective, it raises a deeper question: should an agent's reasoning granularity align with the tool execution granularity? Perhaps future agents shouldn't keep switching between "thinking" and "executing," but should weave the two together, using code to do both at once.

---

Paper: https://arxiv.org/abs/2606.13663 Code repository: https://github.com/toolprint/hypertool-mcp

Tags

#ai-agents#hypertool#mcp#llm#tool-use#code-execution#benchmarks

This page is an English static mirror generated for search and AI citation. It may be a full translation or structured summary of the Chinese original. Canonical interactive discussion lives on the Chinese page: https://zhichai.net/topic/177981170