y0news
← Feed
Back to feed
🧠 AI🟢 BullishImportance 7/10

Contract2Tool: Learning Preconditions and Effects for Reliable Tool-Augmented LLM Agents

arXiv – CS AI|Rahul Suresh Babu, Laxmipriya Ganesh Iyer|
🤖AI Summary

Contract2Tool is a framework that automatically infers tool contracts (preconditions, effects, risk levels) for large language model agents from documentation and execution traces, enabling reliable tool use without manual specification. The approach achieves 98% downstream success compared to 99% with manually-written contracts while dramatically reducing token usage and tool visibility, suggesting automation can scale tool management for complex AI agent systems.

Analysis

Contract2Tool addresses a fundamental scaling challenge in AI agent design. As LLM-based systems increasingly rely on external APIs and tools, the gap between tool schemas (which specify how to call tools) and causal appropriateness (when to call them and what effects they produce) creates reliability failures. Manual contract specification doesn't scale to dynamic tool ecosystems with hundreds or thousands of APIs. The framework tackles this by learning tool contracts through hybrid evidence—combining static documentation with dynamic execution traces—and converting them into normalized symbolic representations suitable for downstream filtering systems.

This work builds on growing recognition that agent reliability depends on reasoning about tool effects and state transitions, not just input-output formatting. Previous approaches required extensive manual annotation, limiting deployment. Contract2Tool demonstrates that learned contracts from documentation plus execution data can preserve most reliability benefits of gold-standard manual contracts, achieving 0.98 success rate versus 0.99 for hand-written contracts.

The practical impact spans both developer productivity and system efficiency. In testing, learned contracts reduced visible tools from 100 to just 1 and cut average token usage from 26,172 to 2,528 per task—dramatic efficiency gains that translate directly to reduced costs and latency. For AI infrastructure providers and companies building multi-step autonomous agents, this suggests a scalable path to reliable tool management without bottlenecking on contract authorship. The work establishes automated contract inference as viable, opening pathways for systems that adapt to changing tool landscapes dynamically.

Key Takeaways
  • Contract2Tool automatically learns tool preconditions and effects from documentation and execution traces, eliminating manual specification bottlenecks for AI agent tools.
  • Learned contracts achieve 98% of the success rate of manually-written gold contracts while reducing token usage by 90% and visible tools by 99%.
  • Hybrid evidence combining static documentation with dynamic execution traces produces the highest-quality learned contracts for multi-step agent tasks.
  • The framework enables scalable tool management for large and changing API ecosystems, addressing a key constraint in deploying reliable LLM agents.
  • Automated contract layers between tool schemas and agent execution can substantially improve both reliability and computational efficiency of autonomous systems.
Read Original →via arXiv – CS AI
Act on this with AI
Stay ahead of the market.
Connect your wallet to an AI agent. It reads balances, proposes swaps and bridges across 15 chains — you keep full control of your keys.
Connect Wallet to AI →How it works
Related Articles