Skip to main content
Glama
phantosmax

CloudStack MCP Server

by phantosmax

list_networks

Discover available networks in the CloudStack MCP Server by filtering based on zone, type, or default status. Manage and query network configurations efficiently.

Instructions

List networks

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
isdefaultNoFilter by default networks
typeNoNetwork type (Isolated, Shared, L2)
zoneidNoZone ID to filter networks

Implementation Reference

  • The main handler function that executes the list_networks tool logic: calls CloudStack API, processes networks, formats output as MCP content.
    async handleListNetworks(args: any) { const result = await this.cloudStackClient.listNetworks(args); const networks = result.listnetworksresponse?.network || []; const networkList = networks.map((network: any) => ({ id: network.id, name: network.name, displaytext: network.displaytext, type: network.type, state: network.state, zonename: network.zonename, cidr: network.cidr, gateway: network.gateway, netmask: network.netmask, vlan: network.vlan, broadcasturi: network.broadcasturi, traffictype: network.traffictype })); return { content: [ { type: 'text', text: `Found ${networkList.length} networks:\n\n${networkList .map((net: any) => `• ${net.name} (${net.id})\n Display Text: ${net.displaytext}\n Type: ${net.type}\n State: ${net.state}\n Zone: ${net.zonename}\n CIDR: ${net.cidr}\n Gateway: ${net.gateway}\n Netmask: ${net.netmask}\n VLAN: ${net.vlan || 'N/A'}\n` ) .join('\n')}` } ] }; }
  • Tool schema definition including name, description, and input schema for list_networks.
    { name: 'list_networks', description: 'List networks', inputSchema: { type: 'object', properties: { zoneid: { type: 'string', description: 'Zone ID to filter networks', }, type: { type: 'string', description: 'Network type (Isolated, Shared, L2)', }, isdefault: { type: 'boolean', description: 'Filter by default networks', }, }, additionalProperties: false, }, },
  • src/server.ts:150-151 (registration)
    Registration and dispatch of the list_networks tool in the MCP server request handler switch statement.
    case 'list_networks': return await this.networkHandlers.handleListNetworks(args);
  • CloudStack client helper method that makes the API request for listing networks.
    async listNetworks(params: CloudStackParams = {}): Promise<CloudStackResponse> { return this.request('listNetworks', 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