Skip to main content
Glama

get_vm_drives

Retrieve disk drive information for a virtual machine in VergeOS to manage storage resources and monitor VM configurations.

Instructions

Get disk drives for a VM

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesVM ID

Implementation Reference

  • Core handler function in VergeOSAPI class that implements the logic for retrieving VM disk drives by first obtaining the machine ID from the VM details and querying the VergeOS API endpoint /api/v4/machine_drives, then filtering results.
    async getVMDrives(vmId) { // Get VM to find machine ID (same pattern as getVMNics) const vm = await this.getVM(vmId); const machineId = vm.machine; const drives = await this.request(`/api/v4/machine_drives?machine=${machineId}&fields=all`); // Filter to only this machine's drives (API quirk) return drives.filter((d) => d.machine === machineId); }
  • Tool schema definition including name, description, and input schema requiring a numeric VM ID.
    name: "get_vm_drives", description: "Get disk drives for a VM", inputSchema: { type: "object", properties: { id: { type: "number", description: "VM ID", }, }, required: ["id"], }, },
  • src/index.js:560-562 (registration)
    Registration and dispatch of the get_vm_drives tool within the main tool call handler switch statement.
    case "get_vm_drives": result = await api.getVMDrives(args.id); break;
  • Alternative direct-mode handler with additional field mapping including computed size_gb.
    async function getVMDrives(vmId) { // Get VM to find machine ID (same pattern as getVMNics) const vm = await getVM(vmId); const machineId = vm.machine; const drives = await apiRequest(`/api/v4/machine_drives?machine=${machineId}&fields=all`); return drives.filter(d => d.machine === machineId).map(d => ({ id: d.$key, name: d.name, size_bytes: d.disksize, size_gb: Math.round(d.disksize / 1073741824 * 10) / 10, interface: d.interface_type, media: d.media_type, })); }
  • Schema definition in the direct proxy implementation.
    { name: "get_vm_drives", description: "Get VM disk drives", inputSchema: { type: "object", properties: { id: { type: "number", description: "VM ID" } }, required: ["id"] } },

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/dvvincent/vergeos-mcp-server'

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