Skip to main content
Glama
phantosmax

CloudStack MCP Server

by phantosmax

list_security_groups

Retrieve and filter security groups in Apache CloudStack by name or associated virtual machine ID. Manage cloud resources efficiently with this integration tool.

Instructions

List security groups

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
securitygroupnameNoSecurity group name to filter
virtualmachineidNoVM ID to show associated security groups

Implementation Reference

  • The main handler function for the 'list_security_groups' tool. It calls the CloudStack client to list security groups, processes the response, and formats it as a text content block for the MCP response.
    async handleListSecurityGroups(args: any) {
      const result = await this.cloudStackClient.listSecurityGroups(args);
      const securityGroups = result.listsecuritygroupsresponse?.securitygroup || [];
      
      const securityGroupList = securityGroups.map((sg: any) => ({
        id: sg.id,
        name: sg.name,
        description: sg.description,
        account: sg.account,
        domain: sg.domain,
        ingressrule: sg.ingressrule || [],
        egressrule: sg.egressrule || []
      }));
    
      return {
        content: [
          {
            type: 'text',
            text: `Found ${securityGroupList.length} security groups:\n\n${securityGroupList
              .map((sg: any) => 
                `• ${sg.name} (${sg.id})\n  Description: ${sg.description}\n  Account: ${sg.account}\n  Domain: ${sg.domain}\n  Ingress Rules: ${sg.ingressrule.length}\n  Egress Rules: ${sg.egressrule.length}\n`
              )
              .join('\n')}`
          }
        ]
      };
    }
  • The tool definition including name, description, and input schema for 'list_security_groups'.
    {
      name: 'list_security_groups',
      description: 'List security groups',
      inputSchema: {
        type: 'object',
        properties: {
          securitygroupname: {
            type: 'string',
            description: 'Security group name to filter',
          },
          virtualmachineid: {
            type: 'string',
            description: 'VM ID to show associated security groups',
          },
        },
        additionalProperties: false,
      },
    },
  • src/server.ts:204-205 (registration)
    Registration and dispatch of the 'list_security_groups' tool in the MCP server's CallToolRequestSchema handler switch statement.
    case 'list_security_groups':
      return await this.securityHandlers.handleListSecurityGroups(args);
  • Helper method in CloudStackClient that performs the actual API request to CloudStack's listSecurityGroups endpoint.
    async listSecurityGroups(params: CloudStackParams = {}): Promise<CloudStackResponse> {
      return this.request('listSecurityGroups', params);
    }
Behavior2/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 security groups' implies a read-only operation but does not specify whether it returns all security groups, requires permissions, supports pagination, or has rate limits. For a tool with potential security implications, this lack of detail 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.

Conciseness4/5

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

The description is extremely concise with just three words, making it front-loaded and waste-free. However, it is overly terse to the point of under-specification, lacking necessary context for effective use. While efficient, it sacrifices clarity for brevity.

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 no annotations and no output schema, the description is incomplete for a tool that lists security groups—a critical security resource. It fails to explain return values, error conditions, or how parameters interact (e.g., filtering by name vs. VM association). In a server with many infrastructure management tools, this leaves too much undefined for reliable agent operation.

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?

Schema description coverage is 100%, with clear parameter descriptions in the input schema (e.g., 'Security group name to filter', 'VM ID to show associated security groups'). The tool description adds no parameter information beyond the schema, but the schema adequately documents the two optional parameters, meeting the baseline for high coverage.

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 security groups' is a tautology that restates the tool name without adding meaningful context. It specifies the verb 'list' and resource 'security groups', but lacks details about scope, format, or differentiation from sibling tools like 'create_security_group_rule' or 'list_networks'. This minimal statement provides no insight beyond the obvious.

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?

There is no guidance on when to use this tool versus alternatives. The description does not mention filtering capabilities (via parameters), prerequisites, or related tools for creating or modifying security groups. With many sibling tools for managing virtual machines and networks, the absence of usage context leaves the agent guessing about appropriate scenarios.

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