@tpmjs/tools-slo-draft
Draft Service Level Objective (SLO) definitions for a service. Provide the service name and metrics (with name, target percentage, and time window) to generate a comprehensive SLO document in markdown format with error budgets, alerting strategies, and monitoring recommendations.
Test @tpmjs/tools-slo-draft (sloDraftTool) with AI-powered execution
0/2000 characters
Install this tool and use it with the AI SDK
npm install @tpmjs/tools-slo-draftpnpm add @tpmjs/tools-slo-draftyarn add @tpmjs/tools-slo-draftbun add @tpmjs/tools-slo-draftdeno add npm:@tpmjs/tools-slo-draftimport { sloDraftTool } from '@tpmjs/tools-slo-draft';import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
import { sloDraftTool } from '@tpmjs/tools-slo-draft';
const result = await generateText({
model: openai('gpt-4o'),
tools: { sloDraftTool },
prompt: 'Your prompt here...',
});
console.log(result.text);Available configuration options
serviceNamestringName of the service (e.g., "API Gateway", "Payment Service")
metricsarrayArray of SLO metrics with name, target (percentage), and window (e.g., "30d", "7d")
Schema extracted: 1/1/2026, 8:17:57 AM
Draft Service Level Objective (SLO) definitions for services with comprehensive documentation, error budgets, and alerting strategies.
npm install @tpmjs/tools-slo-draft
import { sloDraftTool } from '@tpmjs/tools-slo-draft'; // Use with Vercel AI SDK const result = await sloDraftTool.execute({ serviceName: 'Payment API', metrics: [ { name: 'Availability', target: 99.9, window: '30d' }, { name: 'API Latency P99', target: 95.0, window: 'rolling 7 days' }, { name: 'Error Rate', target: 99.5, window: '30d' } ] }); console.log(result.slo); // Markdown formatted SLO document console.log(result.summary); // Brief summary console.log(result.metrics); // Processed metrics with severity
serviceName (string, required): Name of the servicemetrics (array, required): Array of metric objects with:
name (string): Metric name (e.g., "Availability", "Latency P99")target (number): Target percentage (0-100)window (string): Time window (e.g., "30d", "7 days", "rolling 30 days")Returns an object with:
slo (string): Comprehensive SLO document in markdown formatmetrics (array): Processed metrics with additional metadata:
windowType: 'rolling' or 'calendar'severity: 'critical' (≥99.9%), 'high' (≥99%), or 'medium' (<99%)summary (string): Brief summary of the SLOmetadata (object):
serviceName: Service namecreatedAt: ISO timestamptotalMetrics: Total number of metricscriticalMetrics: Number of critical severity metricsThe tool generates a markdown document including:
MIT
Downloads/month
43
Quality Score