all_services_diagnostics
Analyze and resolve stuck queue items across media services to maintain workflow continuity and prevent processing delays.
Instructions
Analyze and auto-fix stuck queue items across all services
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| autoFix | No |
Implementation Reference
- src/index.ts:381-425 (handler)The main handler function for the 'all_services_diagnostics' tool. It iterates over all registered services, calls queueDiagnostics on each (with optional autoFix), aggregates statistics on queue items, issues, fixes, failures, and manual interventions needed, and returns a comprehensive summary.private async runAllServicesDiagnostics(autoFix = true) { const allServices = serviceRegistry.getAll(); const serviceResults = []; let totalQueueItems = 0; let totalIssuesFound = 0; let totalFixed = 0; let totalFailed = 0; let totalRequiresManual = 0; for (const service of allServices) { try { const diagnostics = await service.queueDiagnostics(autoFix); if (diagnostics.ok && diagnostics.data) { serviceResults.push(diagnostics.data); totalQueueItems += diagnostics.data.totalQueueItems; totalIssuesFound += diagnostics.data.issuesFound; totalFixed += diagnostics.data.summary.fixed; totalFailed += diagnostics.data.summary.failed; totalRequiresManual += diagnostics.data.summary.requiresManual; } } catch (error) { console.error( `Failed to run diagnostics for ${service.serviceName}:`, error, ); } } return { ok: true, data: { totalServices: allServices.length, servicesScanned: allServices.map((s) => s.serviceName), overallSummary: { totalQueueItems, totalIssuesFound, totalFixed, totalFailed, totalRequiresManual, }, serviceResults, }, }; }
- src/index.ts:146-156 (registration)Registration of the 'all_services_diagnostics' tool in the tools array, including its name, description, and input schema definition.{ name: "all_services_diagnostics", description: "Analyze and auto-fix stuck queue items across all services", inputSchema: { type: "object", properties: { autoFix: { type: "boolean" }, }, required: [], }, },
- src/index.ts:185-203 (schema)Shared Zod InputSchema used for parsing tool arguments, including the 'autoFix' boolean optional parameter required by 'all_services_diagnostics'.const InputSchema = z.object({ service: z.string().optional(), title: z.string().optional(), page: z.number().optional(), pageSize: z.number().optional(), ids: z.array(z.number()).optional(), since: z.string().optional(), limit: z.number().optional(), query: z.string().optional(), foreignId: z.number().optional(), rootFolderPath: z.string().optional(), qualityProfileId: z.number().optional(), monitored: z.boolean().optional(), autoFix: z.boolean().optional(), services: z.array(z.string()).optional(), includeDownloader: z.boolean().optional(), downloader: z.string().optional(), detailed: z.boolean().optional(), });
- src/index.ts:253-256 (handler)Dispatch logic in the CallToolRequestSchema handler that routes calls to 'all_services_diagnostics' to the runAllServicesDiagnostics method.} else if (name === "all_services_diagnostics") { result = await debugToolTiming(name, "multi", () => this.runAllServicesDiagnostics(input.autoFix ?? true), );