@tpmjs/tools-postmortem-draft
Draft postmortem documents from incident details with timeline and action items. Creates structured incident analysis documentation following SRE best practices.
Test @tpmjs/tools-postmortem-draft (postmortemDraftTool) with AI-powered execution
0/2000 characters
Install this tool and use it with the AI SDK
npm install @tpmjs/tools-postmortem-draftpnpm add @tpmjs/tools-postmortem-draftyarn add @tpmjs/tools-postmortem-draftbun add @tpmjs/tools-postmortem-draftdeno add npm:@tpmjs/tools-postmortem-draftimport { postmortemDraftTool } from '@tpmjs/tools-postmortem-draft';import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
import { postmortemDraftTool } from '@tpmjs/tools-postmortem-draft';
const result = await generateText({
model: openai('gpt-4o'),
tools: { postmortemDraftTool },
prompt: 'Your prompt here...',
});
console.log(result.text);Available configuration options
titlestringTitle of the incident
timelinearrayArray of timeline events
rootCausestringRoot cause analysis of the incident
actionItemsarrayArray of action items to prevent recurrence
Schema extracted: 1/1/2026, 8:18:30 AM
Draft postmortem documents from incident details with timeline and action items.
npm install @tpmjs/tools-postmortem-draft
import { postmortemDraftTool } from '@tpmjs/tools-postmortem-draft'; const result = await postmortemDraftTool.execute({ title: 'Database Connection Pool Exhaustion', timeline: [ { time: '2025-01-15T14:23:00Z', event: 'First alerts for elevated error rates', }, { time: '2025-01-15T14:25:00Z', event: 'Connection pool exhaustion confirmed', }, { time: '2025-01-15T14:30:00Z', event: 'Emergency pool size increase deployed', }, { time: '2025-01-15T14:35:00Z', event: 'Service restored, errors subsiding', }, { time: '2025-01-15T14:45:00Z', event: 'Incident resolved, monitoring continues', }, ], rootCause: 'Database connection pool size was set to 10 connections, which was insufficient for peak traffic. A code deployment earlier that day introduced a connection leak that slowly exhausted the pool.', actionItems: [ 'Increase connection pool size from 10 to 50', 'Add connection pool monitoring and alerting', 'Review code for connection leaks and add tests', 'Implement circuit breaker pattern for database calls', ], }); console.log(result.postmortem); // Markdown-formatted postmortem document console.log(`Severity: ${result.severity}`); console.log(`Duration: ${result.duration}`);
title (string, required): Title of the incidenttimeline (array, required): Array of timeline eventsrootCause (string, required): Root cause analysisactionItems (array, required): Array of action itemstime (string, required): Timestamp of the event (ISO 8601 recommended)event (string, required): Description of what happenedpostmortem (string): Markdown-formatted postmortem documentseverity (string): Assessed severity ('low' | 'medium' | 'high' | 'critical')duration (string | null): Calculated incident durationThe tool automatically assesses severity based on keywords and timeline:
MIT
Downloads/month
0
Quality Score