Skip to main content
Glama
phantosmax

CloudStack MCP Server

by phantosmax

list_clusters

Retrieve a list of clusters in the CloudStack MCP Server, filtered by zone ID or hypervisor type, to manage and monitor cloud resources efficiently.

Instructions

List clusters

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hypervisorNoHypervisor type
zoneidNoZone ID to filter clusters

Implementation Reference

  • The main handler function for the 'list_clusters' tool. It invokes the CloudStack client to list clusters, processes the response by mapping cluster details, and formats it as a structured text content block for the MCP protocol response.
    async handleListClusters(args: any) {
      const result = await this.cloudStackClient.listClusters(args);
      const clusters = result.listclustersresponse?.cluster || [];
      
      const clusterList = clusters.map((cluster: any) => ({
        id: cluster.id,
        name: cluster.name,
        zonename: cluster.zonename,
        hypervisortype: cluster.hypervisortype,
        clustertype: cluster.clustertype,
        allocationstate: cluster.allocationstate,
        managedstate: cluster.managedstate
      }));
    
      return {
        content: [
          {
            type: 'text',
            text: `Found ${clusterList.length} clusters:\n\n${clusterList
              .map((cluster: any) => 
                `• ${cluster.name} (${cluster.id})\n  Zone: ${cluster.zonename}\n  Hypervisor: ${cluster.hypervisortype}\n  Type: ${cluster.clustertype}\n  Allocation State: ${cluster.allocationstate}\n  Managed State: ${cluster.managedstate}\n`
              )
              .join('\n')}`
          }
        ]
      };
    }
  • The tool definition object for 'list_clusters', including the name, description, and inputSchema for validation of parameters like zoneid and hypervisor.
    {
      name: 'list_clusters',
      description: 'List clusters',
      inputSchema: {
        type: 'object',
        properties: {
          zoneid: {
            type: 'string',
            description: 'Zone ID to filter clusters',
          },
          hypervisor: {
            type: 'string',
            description: 'Hypervisor type',
          },
        },
        additionalProperties: false,
      },
    },
  • src/server.ts:190-191 (registration)
    Registration and dispatch logic in the MCP server's CallToolRequestSchema handler. The switch statement routes calls to the 'list_clusters' tool to the corresponding AdminHandlers method.
    case 'list_clusters':
      return await this.adminHandlers.handleListClusters(args);
  • Supporting method in the CloudStackClient class that wraps the low-level 'listClusters' API request, handling authentication and HTTP communication with the CloudStack server.
    async listClusters(params: CloudStackParams = {}): Promise<CloudStackResponse> {
      return this.request('listClusters', params);
    }
Behavior1/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'List clusters' gives no indication of whether this is a read-only operation, what permissions are required, whether it's paginated, what the output format is, or any rate limits. For a tool with no annotation coverage, this is a significant gap in transparency.

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 extremely concise at just two words, with zero wasted text. It's front-loaded and to the point, though this conciseness comes at the cost of completeness. Every word earns its place by directly stating the action, but it lacks necessary detail.

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

Completeness1/5

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

Given the complexity of a list operation with filtering parameters, no annotations, and no output schema, the description is severely incomplete. It doesn't explain what 'clusters' are in this context, how results are returned, or any behavioral aspects. For a tool with 2 parameters and no structured guidance, this description fails to provide adequate context for an AI agent.

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 clear parameter descriptions for 'hypervisor' and 'zoneid.' The tool description adds no additional parameter semantics beyond what's already in the schema. According to the rules, when schema_description_coverage is high (>80%), the baseline score is 3 even with no param info in the description.

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

Purpose2/5

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

The description 'List clusters' is a tautology that merely restates the tool name without adding any meaningful context. It doesn't specify what type of clusters (compute, storage, network?) or what resource scope (all clusters? filtered?). While it includes the verb 'list,' it lacks the specificity needed to distinguish this tool from other list_* siblings like list_hosts or list_zones.

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

Usage Guidelines1/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 any prerequisites, context for filtering (e.g., hypervisor or zoneid parameters), or relationship to sibling tools like list_hosts or list_zones that might overlap in functionality. This leaves the agent with no usage context.

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