Skip to main content
Glama
jackalterman

Windows Diagnostics MCP Server

by jackalterman

get_shutdown_events

Retrieve shutdown and reboot events from Windows system logs to diagnose system stability. Specify the number of days back to analyze for identifying historical shutdown patterns.

Instructions

Get only shutdown and reboot events

Input Schema

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

Implementation Reference

  • The handler function implementing the core logic for the get_shutdown_events tool. It runs a PowerShell diagnostic script to retrieve shutdown events over a specified period and formats them into a markdown response.
    export async function getShutdownEvents(args: { daysBack?: number }) {
      const daysBack = args?.daysBack || 7;
      const result = await runPowerShellScript(DIAGNOSTIC_SCRIPT, { DaysBack: daysBack, JsonOutput: true }) as AllTypes.DiagnosticResults;
    
      return {
        content: [
          {
            type: 'text',
            text: `# Shutdown and Reboot Events (Last ${daysBack} days)\n\n${result.ShutdownEvents.length > 0 ? 
    result.ShutdownEvents.map((e: AllTypes.EventInfo) => `- **${e.Time}**: ${e.Description} (Event ID: ${e.EventID}, Source: ${e.Source})`).join('\n') 
    : 'No shutdown/reboot events found in the specified period.'}\n\n**Total Events**: ${result.ShutdownEvents.length}\n**Unexpected Shutdowns**: ${result.ShutdownEvents.filter((e: AllTypes.EventInfo) => e.EventID === 6008).length}`,
          },
        ],
      };
    }
  • The input schema definition for the get_shutdown_events tool, registered in the ListTools handler, specifying the expected arguments.
      name: 'get_shutdown_events',
      description: 'Get only shutdown and reboot events',
      inputSchema: {
        type: 'object',
        properties: {
          daysBack: {
            type: 'number',
            description: 'Number of days back to analyze (default: 7)',
            default: 7,
          },
        },
      },
    },
  • src/index.ts:541-542 (registration)
    The registration and dispatch logic in the CallToolRequestSchema handler that routes calls to the getShutdownEvents function in diagnostics module.
    case 'get_shutdown_events':
      return await diagnostics.getShutdownEvents(args as { daysBack?: number });
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states what events are retrieved but doesn't mention critical aspects like whether this is a read-only operation, what format the results come in, potential rate limits, authentication requirements, or how the data is structured. This leaves significant gaps for an agent.

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

Conciseness5/5

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

The description is extremely concise at just 5 words, with zero wasted language. It's front-loaded with the core purpose and contains no unnecessary elaboration, making it highly efficient for an agent to parse.

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?

For a diagnostic tool with no annotations and no output schema, the description is insufficient. It doesn't explain what format the events come in, whether they're filtered or raw, what timezone is used, or how results are structured. Given the complexity of system events and lack of structured output information, more context is needed.

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 schema description coverage is 100%, with the single parameter 'daysBack' fully documented in the schema. The description adds no additional parameter information beyond what the schema already provides, which meets the baseline expectation when schema coverage is complete.

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

Purpose4/5

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

The description clearly states the tool's function with a specific verb ('Get') and resource ('shutdown and reboot events'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_bsod_events' or 'get_system_uptime', which prevents a perfect score.

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?

The description provides no guidance on when to use this tool versus alternatives. With sibling tools like 'get_bsod_events' and 'get_system_uptime' available, there's no indication of when this specific event type is appropriate or what distinguishes it from other diagnostic tools.

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