Scaling Agentic Capabilities, Not Context: Efficient Reinforcement Finetuning for Large Toolspaces

Gupta, Karan, Vajreshwari, Pranav, Pandya, Yash, Magazine, Raghav, Nambi, Akshay, Awadallah, Ahmed

–arXiv.org Artificial Intelligence 

The scaffold exposes a uniform MCPServerabstraction that presents MCP tools as Python-native functions. Tool schemas from heterogeneous servers are normalized into consistent function signatures, verified against underlying APIs, and bound dynamically, insulating agents from JSON-specific idiosyncrasies. Tool outputs are converted into Python-native data structures and retained in program state rather than re-injected into the model context; when output schemas are missing, representative structures are inferred and reused. To support Iterative Tool Loading, a get tools info()interface materializes full function signatures and examples only for selected tools. Even when loaded, these Python-native definitions are substantially more token-efficient than raw JSON, enabling precise grounding while preserving context. Additional implementation details and design choices for the scaffold are provided in Appendix A. 4 3 REINFORCEMENTFINETUNING Reinforcement learning for agentic MCP tasks is challenging due to long-horizon, interdependent decision-making. Correct behavior depends on sequences of tool selection, argument construction, execution order, and grounded use of tool outputs, where early errors can invalidate downstream steps despite a plausible final answer. These challenges are compounded by non-verifiable objectives: MCP tasks rarely have a single ground truth, and multiple execution trajectories may satisfy user intent, making supervision based on final answers or binary success sparse and often misleading. Effective learning therefore requires reward signals that capture procedural quality and task-specific constraints rather than outcomes alone.