Skip to main content
Glama
phantosmax

CloudStack MCP Server

by phantosmax

list_volumes

Retrieve and filter storage volumes in CloudStack MCP Server by VM ID, zone, or type (ROOT, DATADISK). Manage cloud resources efficiently with precise volume listing.

Instructions

List storage volumes

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeNoVolume type (ROOT, DATADISK)
virtualmachineidNoVM ID to filter volumes
zoneidNoZone ID to filter volumes

Implementation Reference

  • The handler function that executes the list_volumes tool logic. It fetches volumes using CloudStackClient, processes the response into a structured list, and formats it as a MCP-compatible text content response.
    async handleListVolumes(args: any) { const result = await this.cloudStackClient.listVolumes(args); const volumes = result.listvolumesresponse?.volume || []; const volumeList = volumes.map((volume: any) => ({ id: volume.id, name: volume.name, type: volume.type, size: volume.size, state: volume.state, zonename: volume.zonename, vmname: volume.vmname, deviceid: volume.deviceid, diskofferingname: volume.diskofferingname, created: volume.created, path: volume.path })); return { content: [ { type: 'text', text: `Found ${volumeList.length} volumes:\n\n${volumeList .map((vol: any) => `• ${vol.name} (${vol.id})\n Type: ${vol.type}\n Size: ${vol.size}GB\n State: ${vol.state}\n Zone: ${vol.zonename}\n VM: ${vol.vmname || 'Not attached'}\n Device ID: ${vol.deviceid || 'N/A'}\n Disk Offering: ${vol.diskofferingname}\n Created: ${vol.created}\n` ) .join('\n')}` } ] }; }
  • Tool definition including name, description, and input schema for the list_volumes tool.
    name: 'list_volumes', description: 'List storage volumes', inputSchema: { type: 'object', properties: { virtualmachineid: { type: 'string', description: 'VM ID to filter volumes', }, zoneid: { type: 'string', description: 'Zone ID to filter volumes', }, type: { type: 'string', description: 'Volume type (ROOT, DATADISK)', }, }, additionalProperties: false, }, },
  • src/server.ts:134-135 (registration)
    Registration of the list_volumes tool in the MCP server's CallToolRequest handler switch statement, dispatching to the StorageHandlers.handleListVolumes method.
    case 'list_volumes': return await this.storageHandlers.handleListVolumes(args);
  • Helper method in CloudStackClient that performs the actual API request to list volumes.
    async listVolumes(params: CloudStackParams = {}): Promise<CloudStackResponse> { return this.request('listVolumes', 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