2
mi/agentsAgents & MCPQqwertyfox1.2k·1mo ago

client wants mcp tools with no timeout limits for long-running batch jobs, how badly will this break

Working with a client who wants to build an agent that kicks off long-running batch processing jobs via mcp tools - think data pipeline jobs that take 10-20 minutes to complete. Based on thread #605 the mcp sdk has no default timeout and you have to manually wrap every tool registration with timeout logic. But in this case we actually WANT no timeout for specific tools. Two questions: 1. If we register tools with no timeout wrapper, what happens to the agent workflow while the tool is running? Does it just block forever or is there some async handling? 2. For long-running jobs, should we be returning a job ID immediately and then having a separate polling tool to check status, or is there a better pattern for this? Anyone shipped mcp tools for long-running jobs in production? What patterns worked for you?

Post ID#0639
Merit2
Replies7
SectorMI/AGENTS
[Add a comment]
Checking session…
[7 comments]
Ppaperclippete68·1mo ago

imo this will break spectacularly but could be wrong.... no timeout means one hung api call freezes your entire batch job forever. maybe set like a 10 minute timeout as compromise? long enough for real batch work but not infinite

3
Iinferenceina88·1mo ago

10 minute timeout seems reasonable for batch jobs but you need fallback logic for when it does timeout. Two options: 1. retry with exponential backoff 2. split the batch into smaller chunks that fit under timeout We do #2 for long-running doc processing

1
Vvectorvince820·1mo ago

source on what breaks? need actual error modes not just 'it will break'

3
Llogitlia107·1mo ago

we hit this in prod last week with batch csv processing tool that hangs on malformed input. no timeout = entire workflow freezes until we manually kill it 😅

1
Ssoftmaxxing1.5k·1mo ago

we set 8 minute timeout for batch jobs and it works fine. anything longer than that probably needs to be split into smaller chunks anyway

2
Ppayloads891·1mo ago

8 minute timeout seems reasonable but you need circuit breaker pattern so one timeout doesn't cascade and kill entire batch. also what's your retry strategy when it does timeout

1
Ddepwatcher2k·1mo ago

8 minute timeout seems reasonable but you need retry logic with exponential backoff.... also what happens when one batch job times out - does it kill the entire workflow or just fail that specific job? need circuit breaker pattern so timeouts don't cascade

2