Skip to main content
Glama

Windows Automation MCP Server

get_disk_info

Retrieve detailed disk information including storage capacity, usage statistics, and partition details for Windows system monitoring and management.

Instructions

获取磁盘信息

Input Schema

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "properties": {}, "type": "object" }

Implementation Reference

  • The handler function that runs PowerShell command to get disk information including drive, total, used, free space in GB and percent used.
    async getDiskInfo() { try { const command = ` Get-PSDrive -PSProvider FileSystem | Where-Object { $_.Used -ne $null } | ForEach-Object { @{ Drive = $_.Name TotalGB = [math]::Round($_.Used / 1GB + $_.Free / 1GB, 2) UsedGB = [math]::Round($_.Used / 1GB, 2) FreeGB = [math]::Round($_.Free / 1GB, 2) PercentUsed = [math]::Round(($_.Used / ($_.Used + $_.Free)) * 100, 2) } } | ConvertTo-Json `; const { stdout } = await execAsync(`powershell -Command "${command.replace(/"/g, '\\"')}"`, { shell: 'powershell.exe' }); let disks = JSON.parse(stdout); if (!Array.isArray(disks)) { disks = [disks]; } return { success: true, disks }; } catch (error) { return { success: false, error: error.message }; } }
  • Tool registration in getToolDefinitions(), including name, description, and empty input schema.
    { name: 'get_disk_info', description: '获取磁盘信息', inputSchema: { type: 'object', properties: {}, }, },
  • Dispatch in executeTool switch statement that calls the getDiskInfo handler.
    case 'get_disk_info': return await this.getDiskInfo();
  • canHandle method includes 'get_disk_info' in supported tools list.
    const tools = ['run_powershell', 'run_cmd', 'get_system_info', 'get_disk_info', 'get_network_info']; return tools.includes(toolName);
  • Input schema definition: object with no required properties.
    inputSchema: { type: 'object', properties: {}, },

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/eva-wanxin-git/windows-automation-mcp'

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