Windows-gpu-info
Retrieve GPU information from Windows system. Get details about your graphics processing unit for diagnostics and monitoring.
Instructions
Get GPU information of the Windows system.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "Windows-gpu-info"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- main.py:193-214 (handler)The handler function for the 'Windows-gpu-info' tool. It runs a PowerShell command to get GPU info via Win32_VideoController, parses JSON output, and returns GPU name + driver version.
def get_gpu_info() -> str: """Get GPU information of the Windows system.""" import json try: output = utils._run_powershell( "Get-CimInstance -Class Win32_VideoController | Select-Object Name, DriverVersion | ConvertTo-Json -Depth 3" ).strip() if not output: return "No GPU information found." data = json.loads(output) if isinstance(data, dict): data = [data] gpu_info = [] for item in data: name = item.get("Name") driver_version = item.get("DriverVersion") if name and driver_version: gpu_info.append(f"GPU: {name}, Driver Version: {driver_version}") return "\n".join(gpu_info) if gpu_info else "No GPU information found." except Exception as e: return f"Error retrieving GPU info: {e}" - main.py:189-192 (registration)The MCP tool registration decorator that registers 'Windows-gpu-info' with a description and binds it to the get_gpu_info handler function.
@mcp.tool( name="Windows-gpu-info", description="Get GPU information of the Windows system." ) - utils.py:20-33 (helper)Helper utility '_run_powershell' used by the GPU tool to execute a PowerShell command and return its stdout.
def _run_powershell(command: str, timeout: int = 10) -> str: """Run a PowerShell command using pwsh if available, else Windows PowerShell.""" import shutil as _shutil import subprocess shell = _shutil.which("pwsh") or "powershell" result = subprocess.run( [shell, "-NoProfile", "-Command", command], capture_output=True, text=True, timeout=timeout, check=True, ) return result.stdout