list_system_vms
Retrieve and filter system VMs (console proxy, secondary storage) by zone, type, and state in CloudStack infrastructure for streamlined management.
Instructions
List system VMs (console proxy, secondary storage)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| state | No | System VM state | |
| systemvmtype | No | System VM type (consoleproxy, secondarystoragevm) | |
| zoneid | No | Zone ID to filter system VMs |
Implementation Reference
- src/handlers/admin-handlers.ts:244-273 (handler)The handler function that executes the tool logic: calls CloudStack client to list system VMs, processes the response, and formats it as MCP content.async handleListSystemVms(args: any) { const result = await this.cloudStackClient.listSystemVms(args); const systemVms = result.listsystemvmsresponse?.systemvm || []; const systemVmList = systemVms.map((vm: any) => ({ id: vm.id, name: vm.name, systemvmtype: vm.systemvmtype, state: vm.state, zonename: vm.zonename, hostid: vm.hostid, hostname: vm.hostname, publicip: vm.publicip, privateip: vm.privateip, linklocalip: vm.linklocalip })); return { content: [ { type: 'text', text: `Found ${systemVmList.length} system VMs:\n\n${systemVmList .map((vm: any) => `• ${vm.name} (${vm.id})\n Type: ${vm.systemvmtype}\n State: ${vm.state}\n Zone: ${vm.zonename}\n Host: ${vm.hostname}\n Public IP: ${vm.publicip}\n Private IP: ${vm.privateip}\n Link Local IP: ${vm.linklocalip}\n` ) .join('\n')}` } ] }; }
- Tool definition including name, description, and input schema for validation.{ name: 'list_system_vms', description: 'List system VMs (console proxy, secondary storage)', inputSchema: { type: 'object', properties: { zoneid: { type: 'string', description: 'Zone ID to filter system VMs', }, systemvmtype: { type: 'string', description: 'System VM type (consoleproxy, secondarystoragevm)', }, state: { type: 'string', description: 'System VM state', }, }, additionalProperties: false, }, },
- src/server.ts:194-195 (registration)Dispatch/registration of the list_system_vms tool call to the admin handler in the MCP server switch statement.case 'list_system_vms': return await this.adminHandlers.handleListSystemVms(args);
- src/cloudstack-client.ts:268-270 (helper)CloudStack client wrapper method that performs the actual API request to listSystemVms.async listSystemVms(params: CloudStackParams = {}): Promise<CloudStackResponse> { return this.request('listSystemVms', params); }