Windows-last-boot-time
Retrieve the exact date and time of the last Windows system boot. Useful for system uptime monitoring and diagnostics.
Instructions
Get the last boot time of the Windows system
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- main.py:50-53 (registration)Registration of the 'Windows-last-boot-time' tool using the @mcp.tool decorator with name and description.
@mcp.tool( name="Windows-last-boot-time", description="Get the last boot time of the Windows system", ) - main.py:54-68 (handler)Handler function 'get_windows_last_boot_time' that executes the tool logic: uses PowerShell to query the Win32_OperatingSystem WMI class for LastBootUpTime.
def get_windows_last_boot_time() -> str: """Get the last boot time of the Windows system.""" import subprocess try: # Use PowerShell to get the last boot time result = subprocess.run( ["powershell", "-Command", "(Get-CimInstance -Class Win32_OperatingSystem).LastBootUpTime"], capture_output=True, text=True, check=True ) return result.stdout.strip() except subprocess.CalledProcessError as e: return f"Error retrieving last boot time: {e}"