Skip to main content
Glama

system_info

Retrieve Windows system information including hardware details, OS configuration, environment variables, and installed software for system analysis and troubleshooting.

Instructions

Comprehensive system information including hardware details, OS info, environment variables, and system configuration

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesThe system information action to perform
categoryNoHardware category to focus on (for hardware_info action)all
filterNoFilter for environment variables or software (supports wildcards)

Implementation Reference

  • The main handler function for the 'system_info' tool. It takes input parameters and dispatches to specific helper methods based on the 'action' parameter.
    async run(args: { action: string; category?: string; filter?: string; }) { try { switch (args.action) { case "get_system_overview": return await this.getSystemOverview(); case "get_hardware_info": return await this.getHardwareInfo(args.category); case "get_os_info": return await this.getOSInfo(); case "get_environment_vars": return await this.getEnvironmentVars(args.filter); case "get_installed_software": return await this.getInstalledSoftware(args.filter); case "get_system_uptime": return await this.getSystemUptime(); case "get_user_info": return await this.getUserInfo(); case "get_system_paths": return await this.getSystemPaths(); default: throw new Error(`Unknown action: ${args.action}`); } } catch (error: any) { return { content: [{ type: "text", text: `❌ System information operation failed: ${error.message}` }], isError: true }; } },
  • Input schema defining the parameters for the 'system_info' tool, including required 'action' and optional 'category' and 'filter'.
    parameters: { type: "object", properties: { action: { type: "string", enum: ["get_system_overview", "get_hardware_info", "get_os_info", "get_environment_vars", "get_installed_software", "get_system_uptime", "get_user_info", "get_system_paths"], description: "The system information action to perform" }, category: { type: "string", enum: ["cpu", "memory", "disk", "network", "all"], description: "Hardware category to focus on (for hardware_info action)", default: "all" }, filter: { type: "string", description: "Filter for environment variables or software (supports wildcards)" } }, required: ["action"] },
  • src/index.ts:38-41 (registration)
    Registration of the 'system_info' tool in the MCP server's listTools handler, providing name, description, and input schema.
    name: systemInfoTool.name, description: systemInfoTool.description, inputSchema: systemInfoTool.parameters },
  • src/index.ts:75-76 (registration)
    Tool call dispatching in the MCP server's callTool handler, invoking systemInfoTool.run() for 'system_info' requests.
    case "system_info": return await systemInfoTool.run(args as any);
  • Helper method for 'get_system_overview' action, gathering basic system info using Node.js os module and PowerShell.
    async getSystemOverview() { try { const nodeInfo = { platform: os.platform(), arch: os.arch(), hostname: os.hostname(), totalMemory: this.formatBytes(os.totalmem()), freeMemory: this.formatBytes(os.freemem()), cpuCount: os.cpus().length, uptime: this.formatUptime(os.uptime()) }; const command = `Get-ComputerInfo | Select-Object WindowsProductName, WindowsVersion, TotalPhysicalMemory, CsProcessors, CsSystemType, TimeZone | Format-List`; const { stdout } = await execAsync(`powershell -Command "${command}"`); const result = `# System Overview\n\n## Basic Information\n` + `- **Hostname**: ${nodeInfo.hostname}\n` + `- **Platform**: ${nodeInfo.platform}\n` + `- **Architecture**: ${nodeInfo.arch}\n` + `- **CPU Cores**: ${nodeInfo.cpuCount}\n` + `- **Total Memory**: ${nodeInfo.totalMemory}\n` + `- **Free Memory**: ${nodeInfo.freeMemory}\n` + `- **System Uptime**: ${nodeInfo.uptime}\n\n` + `## Windows Details\n\`\`\`\n${stdout}\n\`\`\``; return { content: [{ type: "text", text: result }] }; } catch (error: any) { throw new Error(`Failed to get system overview: ${error.message}`); } },

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/guangxiangdebizi/windows-system-mcp'

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