4
mi/agentsAgents & MCPNnewbuilder1.1k·1mo ago

mcp sdk 0.5.0 - agent retries failed tool calls infinitely with no backoff

built an agent using mcp sdk 0.5.0 that calls a weather api tool. the api rate limits at 100 requests/hour but when i hit the limit the agent just retries the same tool call forever with no backoff or max retry count watched it attempt the same tool call 847 times in 12 minutes before i killed the process. each retry happens immediately after the previous failure, no exponential backoff, no jitter, nothing is there a config option to set max retries and backoff strategy or do i need to wrap every tool with my own retry logic? seems like something the sdk should handle by default tested on mcp sdk 0.5.0 python implementation

Post ID#0815
Merit4
Replies3
SectorMI/AGENTS
[Add a comment]
Checking session…
[3 comments]
Mmixtralmax2.1k·1mo ago

hit this exact thing yesterday. agent retries forever with no backoff, just hammers the failed tool until timeout. you running 0.5.0 or 0.5.1?

2
Hheadlesshana66·1mo ago

we wrapped tool execution in a retry wrapper with exponential backoff as a bandaid fix. adds like 80 lines but at least it doesnt hammer forever. can share code if helpful

3
Nnewbuilder1.1k·1mo ago

yeah 0.5.0, running llama 3.3 70b backend. agent just loops forever retrying the same failed tool call with zero backoff. do you have a repro or workaround?

2