As AI agents increasingly rely on external tools, accurate retrieval is essential for reliable behavior. Existing methods optimize semantic relevance but largely ignore tool availability during execution. To address this gap, we propose RATED (Reliability-Aware Tool Retrieval via Execution Dynamics), a retrieval framework that combines robust semantic matching with dynamic reliability adaptation. RATED employs a frozen dual-encoder with contrastive fine-tuning for semantic matching, and a lightweight contextual bandit module that re-ranks candidates based on real-time execution feedback. This design enables rapid adaptation to runtime tool failures without expensive model retraining. We introduce EcoAgent, a benchmark of 5,172 real-world tools and over 210,000 query-tool pairs for offline retrieval and dynamic reliability evaluation. Experimental results demonstrate that RATED achieves a 52.2% relative MRR improvement over the ToolLLM API retriever on real-world queries, and reduces fault selection rate from 86.2% to 2.9% under severe API outage scenarios with a 30% failure rate, while incurring negligible latency overhead of less than 1 ms over encode-only inference. The code and dataset are available at https://github.com/Elliotes/EcoAgent.
Figures & tables
Figure 1. Tool repository growth and reliability gap on the left, and skewed tag distribution on the right. Left panel shows tool repository growth timeline from February 2025 to January 2026, with total tools (blue line) and reliable tools (orange line). Right panel shows tag word cloud visualization.
Figure 3. RATED architecture with DRAGON retrieval, bandit re-ranking, and execution feedback. RATED architecture with DRAGON dual-encoder retrieval, bandit re-ranking, and execution feedback.
Method
EcoAgent-Syn
EcoAgent-Real
MRR
Recall@1
Recall@5
MRR
Recall@1
Recall@5
TF-IDF
0.680
0.607
0.769
0.274
0.116
0.326
BM25
0.235
0.178
0.300
0.169
0.078
0.194
OpenAI Ada-002
0.790
0.736
0.857
0.670
0.430
0.750
BGE-M3
0.765
0.702
0.840
0.511
0.289
0.579
GTE-Large
0.772
0.713
0.842
0.515
0.294
0.581
Table 1. Retrieval performance on EcoAgent-Syn and EcoAgent-Real.
Method
Failure Rate 20%
Failure Rate 30%
Post-Fail SR (%) ↑
FSR (%) ↓
AS ↓
Post-Fail SR (%) ↑
FSR (%) ↓
AS ↓
BM25
18.8
20.0
Failed
10.2
30.0
Failed
ToolLLM API Retriever
17.4
79.6
Failed
10.5
86.2
Failed
OpenAI Ada-002
19.4
80.4
Failed
11.1
88.8
Failed
DRAGON (pretrained)
78.1
18.1
Failed
75.7
21.2
Failed
SPLADE-v3
16.0
7.7
Failed
15.8
9.1
Failed
Table 2. Dynamic reliability evaluation under injected tool failures.
Figure 4. Hyperparameter sensitivity at 20% failure injection. Two-panel sensitivity analysis under 20 percent failure injection. Left panel plots fault selection rate versus semantic weight w1 for three static-prior weights w3. Right panel plots fault selection rate versus discount factor gamma for three exploration coefficients alpha. Vertical dotted lines mark default hyperparameters.
School of Mathematical Sciences, Shanghai Jiao Tong University · Department of Data Science and Artificial Intelligence, The Hong Kong Polytechnic University