Skip to main content
Glama
phantosmax

CloudStack MCP Server

by phantosmax

list_load_balancer_rules

Retrieve load balancer rules for specified public IP or zone on CloudStack MCP Server to manage network traffic distribution effectively.

Instructions

List load balancer rules

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
publicipidNoPublic IP ID to filter rules
zoneidNoZone ID to filter rules

Implementation Reference

  • The handler function that implements the core logic of the 'list_load_balancer_rules' tool. It calls the CloudStack client to list rules, processes the response, and formats it as MCP content.
    async handleListLoadBalancerRules(args: any) { const result = await this.cloudStackClient.listLoadBalancerRules(args); const rules = result.listloadbalancerrulesresponse?.loadbalancerrule || []; const ruleList = rules.map((rule: any) => ({ id: rule.id, name: rule.name, algorithm: rule.algorithm, state: rule.state, publicip: rule.publicip, publicport: rule.publicport, privateport: rule.privateport, description: rule.description })); return { content: [ { type: 'text', text: `Found ${ruleList.length} load balancer rules:\n\n${ruleList .map((rule: any) => `• ${rule.name} (${rule.id})\n Public IP: ${rule.publicip}:${rule.publicport}\n Private Port: ${rule.privateport}\n Algorithm: ${rule.algorithm}\n State: ${rule.state}\n` ) .join('\n')}` } ] }; }
  • The tool schema definition for 'list_load_balancer_rules', including input schema for parameters like publicipid and zoneid.
    { name: 'list_load_balancer_rules', description: 'List load balancer rules', inputSchema: { type: 'object', properties: { publicipid: { type: 'string', description: 'Public IP ID to filter rules', }, zoneid: { type: 'string', description: 'Zone ID to filter rules', }, }, additionalProperties: false, }, },
  • src/server.ts:162-163 (registration)
    Registration of the tool in the MCP server's request handler switch statement, dispatching to the network handler.
    case 'list_load_balancer_rules': return await this.networkHandlers.handleListLoadBalancerRules(args);
  • Helper method in the CloudStack client that makes the actual 'listLoadBalancerRules' API request.
    async listLoadBalancerRules(params: CloudStackParams = {}): Promise<CloudStackResponse> { return this.request('listLoadBalancerRules', params); }

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