Skip to main content
Glama

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
NameRequiredDescriptionDefault
autoFixNo

Implementation Reference

  • 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: [],
      },
    },
  • 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(),
    });
  • 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),
      );

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/thesammykins/FlixBridge'

If you have feedback or need assistance with the MCP directory API, please join our Discord server