Skip to main content
Glama
phantosmax

CloudStack MCP Server

by phantosmax

list_virtual_machines

Retrieve a list of virtual machines in Apache CloudStack by filtering results using zone ID, VM state, or keywords for efficient cloud resource management.

Instructions

List virtual machines in CloudStack

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keywordNoKeyword to search VMs
stateNoVM state (Running, Stopped, etc.)
zoneidNoZone ID to filter VMs

Implementation Reference

  • The main execution logic for the list_virtual_machines tool. Fetches VMs from CloudStack API and formats a detailed text list response.
    async handleListVirtualMachines(args: any) {
      const result = await this.cloudStackClient.listVirtualMachines(args);
      const vms = result.listvirtualmachinesresponse?.virtualmachine || [];
      
      const vmList = vms.map((vm: any) => ({
        id: vm.id,
        name: vm.name,
        displayname: vm.displayname,
        state: vm.state,
        zonename: vm.zonename,
        templatename: vm.templatename,
        serviceofferingname: vm.serviceofferingname,
        cpunumber: vm.cpunumber,
        memory: vm.memory,
        networkkbsread: vm.networkkbsread,
        networkkbswrite: vm.networkkbswrite,
        diskioread: vm.diskioread,
        diskiowrite: vm.diskiowrite,
        disksize: vm.disksize,
        created: vm.created,
        ipaddress: vm.nic?.[0]?.ipaddress,
        hostname: vm.hostname
      }));
    
      return {
        content: [
          {
            type: 'text',
            text: `Found ${vmList.length} virtual machines:\n\n${vmList
              .map((vm: any) => 
                `• ${vm.name} (${vm.id})\n  Display Name: ${vm.displayname}\n  State: ${vm.state}\n  Zone: ${vm.zonename}\n  Template: ${vm.templatename}\n  Service Offering: ${vm.serviceofferingname}\n  CPUs: ${vm.cpunumber}, RAM: ${vm.memory}MB\n  IP Address: ${vm.ipaddress}\n  Created: ${vm.created}\n`
              )
              .join('\n')}`
          }
        ]
      };
    }
  • Tool schema definition specifying the name, description, and input parameters for list_virtual_machines.
    {
      name: 'list_virtual_machines',
      description: 'List virtual machines in CloudStack',
      inputSchema: {
        type: 'object',
        properties: {
          zoneid: {
            type: 'string',
            description: 'Zone ID to filter VMs',
          },
          state: {
            type: 'string',
            description: 'VM state (Running, Stopped, etc.)',
          },
          keyword: {
            type: 'string',
            description: 'Keyword to search VMs',
          },
        },
        additionalProperties: false,
      },
    },
  • src/server.ts:108-109 (registration)
    MCP server registration that dispatches list_virtual_machines tool calls to the VM handler.
    case 'list_virtual_machines':
      return await this.vmHandlers.handleListVirtualMachines(args);
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It only states the basic action ('List') without mentioning whether this is a read-only operation, if it requires authentication, what the output format looks like, or if there are pagination or rate limits. This leaves significant gaps for a tool that interacts with cloud infrastructure.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without any unnecessary words. It's front-loaded and wastes no space, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete. It doesn't address behavioral aspects like safety, authentication, or output format, which are critical for a tool listing virtual machines in a cloud environment. The high schema coverage helps with parameters, but overall context is insufficient.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, with all three parameters ('keyword', 'state', 'zoneid') clearly documented in the schema. The description adds no additional parameter information beyond what the schema provides, so it meets the baseline for high schema coverage without compensating with extra details.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('List') and resource ('virtual machines in CloudStack'), making the purpose immediately understandable. It distinguishes itself from siblings like 'get_virtual_machine' (singular) and 'list_virtual_machine_metrics' (metrics-focused), though it doesn't explicitly mention these distinctions.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'get_virtual_machine' for single VM details or 'list_virtual_machine_metrics' for performance data, nor does it specify prerequisites or exclusions for usage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

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/phantosmax/cloudstack-mcp-server'

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