Skip to main content
Glama
phantosmax

CloudStack MCP Server

by phantosmax

get_virtual_machine

Retrieve detailed information about a specific virtual machine using its unique VM ID in the CloudStack MCP Server environment.

Instructions

Get details of a specific virtual machine

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesVM ID

Implementation Reference

  • The core handler function that implements the logic for the 'get_virtual_machine' tool. It queries CloudStack API for the VM by ID, handles not found cases, and returns formatted details in MCP content format.
    async handleGetVirtualMachine(args: any) {
      const result = await this.cloudStackClient.listVirtualMachines({ id: args.id });
      const vms = result.listvirtualmachinesresponse?.virtualmachine || [];
      
      if (vms.length === 0) {
        return {
          content: [
            {
              type: 'text',
              text: `Virtual machine with ID ${args.id} not found.`
            }
          ]
        };
      }
    
      const vm = vms[0];
      return {
        content: [
          {
            type: 'text',
            text: `Virtual Machine Details:\n\nID: ${vm.id}\nName: ${vm.name}\nDisplay Name: ${vm.displayname}\nState: ${vm.state}\nZone: ${vm.zonename}\nTemplate: ${vm.templatename}\nService Offering: ${vm.serviceofferingname}\nCPUs: ${vm.cpunumber}\nMemory: ${vm.memory}MB\nIP Address: ${vm.nic?.[0]?.ipaddress}\nHostname: ${vm.hostname}\nCreated: ${vm.created}\nHypervisor: ${vm.hypervisor}\nRoot Device Type: ${vm.rootdevicetype}\nSecurityGroups: ${vm.securitygroup?.map((sg: any) => sg.name).join(', ') || 'None'}`
          }
        ]
      };
    }
  • The tool definition including name, description, and input schema for 'get_virtual_machine', which requires a 'id' string parameter.
    {
      name: 'get_virtual_machine',
      description: 'Get details of a specific virtual machine',
      inputSchema: {
        type: 'object',
        properties: {
          id: {
            type: 'string',
            description: 'VM ID',
          },
        },
        required: ['id'],
        additionalProperties: false,
      },
    },
    {
  • src/server.ts:110-111 (registration)
    Registration in the MCP server request handler switch statement that routes 'get_virtual_machine' calls to the VM handler.
    case 'get_virtual_machine':
      return await this.vmHandlers.handleGetVirtualMachine(args);
  • Aggregation of all tool definitions including virtualMachineTools (which contains get_virtual_machine) for the MCP listTools response.
    export const allToolDefinitions = [
      ...virtualMachineTools,
      ...storageTools,
      ...networkTools,
      ...monitoringTools,
      ...adminTools,
      ...securityTools,
    ];
  • src/cli.ts:334-334 (registration)
    CLI command mapping for 'get-vm' to the 'get_virtual_machine' tool name.
    'get-vm': 'get_virtual_machine',
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 states the tool retrieves details but doesn't specify what details are included, whether it's a read-only operation, if authentication is required, or how errors are handled. This leaves significant gaps in understanding the tool's behavior beyond the basic action.

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 unnecessary words. It's front-loaded with the core action, making it easy to parse quickly.

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

Completeness3/5

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

For a simple read operation with one parameter and no output schema, the description is minimally adequate but lacks completeness. It doesn't explain what details are returned, potential error conditions, or how it differs from similar tools, leaving the agent with incomplete context for effective use.

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 input schema has 100% description coverage, with the 'id' parameter clearly documented as 'VM ID'. The description adds no additional meaning beyond this, as it doesn't elaborate on ID format, sourcing, or validation. Given the high schema coverage, a baseline score of 3 is appropriate.

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 ('Get details') and resource ('of a specific virtual machine'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'list_virtual_machines' (which presumably lists multiple VMs) or 'list_virtual_machine_metrics' (which might provide performance data), so it doesn't fully distinguish from alternatives.

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 'list_virtual_machines' for browsing or 'deploy_virtual_machine' for creation, nor does it specify prerequisites or appropriate contexts for retrieving details of a specific VM.

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