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
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | VM ID |
Implementation Reference
- src/index.js:207-214 (handler)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); }
- src/index.js:350-362 (schema)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;
- local-proxy/index-direct.js:186-195 (handler)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, })); }
- local-proxy/index-direct.js:367-367 (schema)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"] } },