Skip to main content
Glama

get_vm_nics

Retrieve network interface details for a specific virtual machine in VergeOS virtualization platforms to manage connectivity and monitor network configurations.

Instructions

Get network interfaces for a VM

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesVM ID

Implementation Reference

  • Core handler implementation for get_vm_nics tool. Fetches the VM details to obtain machine ID, queries the VergeOS API for machine_nics, filters results, and returns the network interfaces.
    async getVMNics(vmId) { // Get VM to find machine ID const vm = await this.getVM(vmId); const machineId = vm.machine; const nics = await this.request( `/api/v4/machine_nics?machine=${machineId}&fields=most` ); // Filter to only this machine's NICs (API quirk) return nics.filter((nic) => nic.machine === machineId); }
  • Input schema definition for the get_vm_nics tool in the TOOLS array, specifying required VM ID parameter.
    name: "get_vm_nics", description: "Get network interfaces for a VM", inputSchema: { type: "object", properties: { id: { type: "number", description: "VM ID", }, }, required: ["id"], }, },
  • src/index.js:557-559 (registration)
    Dispatch/registration in the tool call handler switch statement, invoking the getVMNics method.
    case "get_vm_nics": result = await api.getVMNics(args.id); break;
  • Alternative handler implementation in direct proxy mode with additional mapping of NIC fields including MAC, IP, etc.
    async function getVMNics(vmId) { // Get VM to find machine ID const vm = await getVM(vmId); const machineId = vm.machine; const nics = await apiRequest(`/api/v4/machine_nics?machine=${machineId}&fields=all`); return nics.filter(n => n.machine === machineId).map(n => ({ id: n.$key, name: n.name, mac: n.macaddress, network_id: n.vnet, ip: n.ipaddress, interface: n.interface, enabled: n.enabled, })); }
  • Schema for get_vm_nics in the direct proxy TOOLS array.
    { name: "get_vm_nics", description: "Get VM network interfaces", inputSchema: { type: "object", properties: { id: { type: "number", description: "VM ID" } }, required: ["id"] } }, { 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