Skip to main content
Glama
jackalterman

Windows Diagnostics MCP Server

by jackalterman

analyze_system_stability

Evaluate Windows system stability by analyzing event logs, crash data, and uptime history. Provides actionable recommendations based on a specified time frame, defaulting to the past 30 days.

Instructions

Analyze system stability and provide recommendations

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
daysBackNoNumber of days back to analyze (default: 30)

Implementation Reference

  • The core handler function that executes the analyze_system_stability tool. It runs a PowerShell diagnostic script, computes a stability score based on BSOD events, shutdowns, crashes, hardware errors, and uptime, then generates a markdown report with rating, issues, recommendations, and metrics.
    export async function analyzeSystemStability(args: { daysBack?: number }) {
      const daysBack = args?.daysBack || 30;
      const result = await runPowerShellScript(DIAGNOSTIC_SCRIPT, { DaysBack: daysBack, JsonOutput: true }) as AllTypes.DiagnosticResults;
    
      const bsodCount = result.BSODEvents.length;
      const unexpectedShutdowns = result.ShutdownEvents.filter((e: AllTypes.EventInfo) => e.EventID === 6008).length;
      const totalCrashes = result.Summary.TotalApplicationCrashes || 0;
      const hardwareErrors = result.HardwareErrors.length;
    
      let stabilityScore = 100;
      const recommendations: string[] = [];
      const issues: string[] = [];
    
      if (bsodCount > 0) {
        stabilityScore -= bsodCount * 20;
        issues.push(`${bsodCount} BSOD event(s)`);
        recommendations.push('Investigate BSOD causes - check Windows Update for driver updates');
      }
    
      if (unexpectedShutdowns > 0) {
        stabilityScore -= unexpectedShutdowns * 10;
        issues.push(`${unexpectedShutdowns} unexpected shutdown(s)`);
        recommendations.push('Check hardware connections and power supply');
      }
    
      if (totalCrashes > 10) {
        stabilityScore -= Math.min(totalCrashes, 30);
        issues.push(`${totalCrashes} application crashes`);
        recommendations.push('Run system file checker: sfc /scannow');
      }
    
      if (hardwareErrors > 0) {
        stabilityScore -= hardwareErrors * 5;
        issues.push(`${hardwareErrors} hardware error(s)`);
        recommendations.push('Check hardware health and run memory diagnostics');
      }
    
      if (result.SystemInfo.CurrentUptimeDays > 30) {
        stabilityScore -= 5;
        recommendations.push('Reboot system to apply updates and clear memory');
      }
    
      stabilityScore = Math.max(0, stabilityScore);
    
      let stabilityRating: string;
      if (stabilityScore >= 90) stabilityRating = 'Excellent ✅';
      else if (stabilityScore >= 75) stabilityRating = 'Good 👍';
      else if (stabilityScore >= 50) stabilityRating = 'Fair ⚠️';
      else stabilityRating = 'Poor ❌';
    
      return {
        content: [
          {
            type: 'text',
            text: `# System Stability Analysis (Last ${daysBack} days)\n\n## Overall Stability Score: ${stabilityScore}/100 (${stabilityRating})\n\n## Issues Detected\n${issues.length > 0 ? issues.map(issue => `- ${issue}`).join('\n') : '- No major issues detected ✅'}\n\n## Recommendations\n${recommendations.length > 0 ? recommendations.map(rec => `- ${rec}`).join('\n') : '- System appears stable, continue regular maintenance'}\n\n## Key Metrics\n- **BSOD Events**: ${bsodCount}\n- **Unexpected Shutdowns**: ${unexpectedShutdowns}\n- **Application Crashes**: ${totalCrashes}\n- **Hardware Errors**: ${hardwareErrors}\n- **Current Uptime**: ${result.SystemInfo.CurrentUptimeDays} days\n\n## Additional Actions\n- Run DISM health check: \`DISM /Online /Cleanup-Image /RestoreHealth\`\n- Check Windows Update for pending updates\n- Review Event Viewer for additional details\n- Consider hardware diagnostics if issues persist`,
          },
        ],
      };
    }
  • The input schema definition for the analyze_system_stability tool, registered in the ListTools response. Defines optional daysBack parameter with default 30.
    {
      name: 'analyze_system_stability',
      description: 'Analyze system stability and provide recommendations',
      inputSchema: {
        type: 'object',
        properties: {
          daysBack: {
            type: 'number',
            description: 'Number of days back to analyze (default: 30)',
            default: 30,
          },
        },
      },
    },
  • src/index.ts:547-548 (registration)
    The registration/dispatch logic in the CallToolRequestSchema handler's switch statement that routes calls to the analyzeSystemStability function from diagnostics module.
    case 'analyze_system_stability':
      return await diagnostics.analyzeSystemStability(args as { daysBack?: number });
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions 'analyze' and 'provide recommendations', implying a read-only operation that might involve computation, but doesn't specify if it requires admin permissions, has side effects, or details the format of recommendations. For a tool with no annotation coverage, this leaves significant gaps in understanding its behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and front-loaded in a single sentence, with no wasted words. However, it could be more structured by explicitly separating the analysis action from the output, but it efficiently conveys the core function without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity implied by 'analyze' and 'recommendations', no annotations, and no output schema, the description is incomplete. It doesn't explain what 'stability' means in this context, what data sources are used, or the format of recommendations. For a tool that likely involves data aggregation and analysis, more context is needed to understand its full scope and output.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with 'daysBack' clearly documented. The description adds no parameter semantics beyond what the schema provides, such as explaining how the analysis period affects results or if there are constraints on the value. With high schema coverage, the baseline score of 3 is appropriate, as the description doesn't compensate but also doesn't detract.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool's purpose ('analyze system stability and provide recommendations'), which is clear but vague. It doesn't specify what 'system stability' entails or how it differs from sibling tools like 'get_system_diagnostics' or 'get_system_uptime'. The description avoids tautology but lacks specificity about the resource or scope.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. With siblings like 'get_system_diagnostics' and 'get_system_uptime', the description doesn't explain if this tool aggregates data from them, provides a higher-level analysis, or serves a distinct purpose. There's no mention of prerequisites, exclusions, or recommended contexts.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

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/jackalterman/windows-diagnostic-mcp-server'

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