list_vms
Retrieve and filter virtual machines in VergeOS by running status or name to manage virtualization resources.
Instructions
List all virtual machines in VergeOS. Can filter by running status or name.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| running | No | Filter to only running VMs | |
| name | No | Filter by VM name (partial match) |
Implementation Reference
- src/index.js:96-107 (handler)Core handler function for list_vms tool. Queries VergeOS API /vms endpoint with optional running and name filters, excludes snapshots.async listVMs(filters = {}) { let query = "?fields=most"; if (filters.running) { query += "&is_running=true"; } if (filters.name) { query += `&name=${encodeURIComponent(filters.name)}`; } // Filter out snapshots/templates by default const vms = await this.request(`/api/v4/vms${query}`); return vms.filter((vm) => !vm.is_snapshot); }
- src/index.js:247-264 (registration)Tool registration in TOOLS array, including name, description, and input schema for list_vms.{ name: "list_vms", description: "List all virtual machines in VergeOS. Can filter by running status or name.", inputSchema: { type: "object", properties: { running: { type: "boolean", description: "Filter to only running VMs", }, name: { type: "string", description: "Filter by VM name (partial match)", }, }, }, },
- src/index.js:539-541 (registration)Dispatch/registration in the MCP tool call switch statement that routes 'list_vms' calls to the api.listVMs handler.case "list_vms": result = await api.listVMs(args || {}); break;
- src/index.js:251-263 (schema)Input schema definition for the list_vms tool, specifying optional running (boolean) and name (string) parameters.inputSchema: { type: "object", properties: { running: { type: "boolean", description: "Filter to only running VMs", }, name: { type: "string", description: "Filter by VM name (partial match)", }, }, },
- src/index.js:681-683 (helper)Usage of listVMs in resource read handler for 'vergeos://vms/list' resource.case "vergeos://vms/list": result = await api.listVMs(); break;