
Company News
Free Business Plan Upgrades for Open Source Maintainers
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.
agentvault-retry
Advanced tools
Resilient MCP tool calls — retry, timeout, and fallback with exponential backoff
Resilient MCP tool calls — retry, timeout, and fallback with exponential backoff.
npm i agentvault-retry
import { withRetry } from 'agentvault-retry';
const result = await withRetry(() =>
client.callTool({ name: 'search', arguments: { q: 'hello' }})
);
import { withTimeout } from 'agentvault-retry';
const result = await withTimeout(
() => client.callTool({ name: 'analyze', arguments: { data: bigData }}),
5000 // 5 second timeout
);
import { resilient } from 'agentvault-retry';
const result = await resilient(
() => client.callTool({ name: 'search', arguments: { q: 'hello' }}),
{
retries: 3, // Max 3 retries
timeoutMs: 5000, // 5s timeout per attempt
baseDelayMs: 1000, // 1s initial backoff
fallback: (err) => ({ // Fallback on total failure
content: [{ type: 'text', text: `Service unavailable: ${err.message}` }]
}),
onRetry: (err, attempt, delay) => {
console.log(`Retry ${attempt} in ${delay}ms: ${err.message}`);
},
}
);
import { withRetry } from 'agentvault-retry';
const result = await withRetry(
() => client.callTool(params),
{
retries: 5,
shouldRetry: (err, attempt) => {
// Only retry on transient errors
return err.code === -32000 || err.message.includes('timeout');
},
}
);
Set AGENTVAULT_TELEMETRY_ENDPOINT to enable anonymous usage telemetry:
export AGENTVAULT_TELEMETRY_ENDPOINT=https://agentvault-telemetry.onrender.com/api/telemetry
No data is sent without this environment variable.
| Function | Description |
|---|---|
withRetry(fn, options?) | Exponential backoff retry |
withTimeout(fn, timeoutMs?) | Timeout wrapper |
resilient(fn, options?) | Retry + timeout + fallback |
flushTelemetry() | Flush telemetry buffer (call on shutdown) |
MIT — Built by AgentVault 🏴☠️
FAQs
Resilient MCP tool calls — retry, timeout, and fallback with exponential backoff
We found that agentvault-retry demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.

Security News
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.

Security News
During a UK cyber test, a Mythos 5 agent used sockpuppets, social engineering, and prompt injection to try to get a maintainer to merge malware.