When webhooks start failing, use this workflow to identify and resolve issues:
Copy
// 1. Ask Claude to investigate failures"Show me all failed webhook events from the last hour"// Claude will use search_events tool:{ "name": "search_events", "arguments": { "status": "failed", "limit": 100 }}// 2. Analyze specific failure"Why did event evt_123 fail?"// Claude will use analyze_event tool:{ "name": "analyze_event", "arguments": { "eventId": "evt_123" }}// 3. Get recommendations"What should I do to fix these webhook failures?"
Track webhook performance and identify bottlenecks:
Copy
// Ask: "Generate a performance report for my webhooks"// The AI will use get_webhook_stats:{ "name": "get_webhook_stats", "arguments": { "timeRange": "24h" }}// Follow up with:// "Which webhook has the slowest response time?"// "Show me the performance trend over the last week"
// Ask: "Show me the payload for the last GitHub webhook"// The AI will:// 1. Read recent events// 2. Filter for GitHub provider// 3. Show the payload data// Or be specific:// "What data did Stripe send in event evt_xyz?"
// Ask: "Find patterns in webhook failures over the last 7 days"// The AI will:{ "name": "get_webhook_stats", "arguments": { "timeRange": "7d" }}// Then analyze error distribution and suggest:// - Common failure causes// - Time-based patterns// - Affected endpoints
// Ask: "Help me replay the failed payment webhooks from today"// The AI will:// 1. Search for failed payment events// 2. Analyze why they failed// 3. Suggest fixes before replay// 4. Provide replay instructions
// Morning routine:"Give me a webhook health summary for the last 24 hours"// The AI provides:// - Total events processed// - Success/failure rates// - Any new error types// - Performance metrics// - Recommendations
// During development:"Show me the test webhooks I sent in the last hour"// Verify payloads:"Is my endpoint receiving the correct Stripe signature?"// Debug issues:"Why is my local endpoint returning 401?"
✓ "Show me failed Stripe webhooks from the last hour"✓ "Why did event evt_123 fail?"✓ "Compare webhook performance this week vs last week"✓ "What's causing timeout errors on my GitHub webhook?"
Copy
✓ "Show me failed Stripe webhooks from the last hour"✓ "Why did event evt_123 fail?"✓ "Compare webhook performance this week vs last week"✓ "What's causing timeout errors on my GitHub webhook?"
Copy
✓ "Analyze all payment webhook failures from today and suggest fixes"✓ "Create a performance report comparing all my webhooks"✓ "Debug evt_123 and show me similar failures"✓ "Find patterns in webhook failures and recommend preventive measures"
// Instead of: "Why are webhooks failing?"// Try: "My Stripe webhooks started failing after deploying v2.1. // Show me what changed and how to fix it."// Instead of: "Show webhook stats" // Try: "Generate a performance report for customer-facing webhooks,// focusing on payment processing delays"
// Morning standup prep:"Generate a daily webhook report with:- Total events processed- Failure rate by provider- New error types since yesterday- Performance degradation warnings- Top 3 issues to address"
// When monitoring alerts trigger:"Investigate webhook alert:- Error rate above 5% for wh_stripe_prod- Started 15 minutes ago- Show me what's failing and why"
// Ask: "Based on recent failures, how should I improve my webhook error handling?"// The AI analyzes failures and suggests:class WebhookHandler { async processWebhook(payload: any) { try { // Validate signature if (!this.validateSignature(payload)) { // AI notices many 401 errors throw new UnauthorizedError('Invalid signature'); } // Process with timeout // AI suggests timeout based on performance stats const result = await Promise.race([ this.process(payload), this.timeout(30000) // 30s based on p99 latency ]); return result; } catch (error) { // AI suggests specific error handling if (error.code === 'ECONNREFUSED') { // Retry logic for connection issues return this.scheduleRetry(payload); } throw error; } }}
// Ask: "Generate monitoring code based on common webhook issues"// The AI creates:class WebhookMonitor { async checkHealth() { // Based on MCP data analysis const stats = await this.getWebhookStats('24h'); // Alert on high failure rate if (stats.failureRate > 0.05) { await this.alert('High failure rate', stats); } // Alert on performance degradation if (stats.p95Latency > 5000) { await this.alert('Slow webhook processing', stats); } }}
// Diagnose: "Why am I not seeing any webhook data?"// The AI will check:// - If webhooks are configured// - If events are being received// - If there are permission issues
// Ask: "Why do some webhooks work but others fail randomly?"// The AI analyzes:// - Success patterns// - Failure patterns// - Environmental factors// - Suggests targeted fixes