Skip to main content
Glama
phantosmax

CloudStack MCP Server

by phantosmax

create_volume

Generate a new storage volume in CloudStack MCP Server by specifying essential parameters like name, disk offering ID, zone ID, and optional custom size, enabling efficient resource allocation for cloud infrastructure.

Instructions

Create a new volume

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
diskofferingidYesDisk offering ID
nameYesVolume name
sizeNoVolume size in GB (for custom disk offerings)
zoneidYesZone ID

Implementation Reference

  • The main handler function for the 'create_volume' tool. It calls the CloudStack client's createVolume method with the provided arguments and returns a formatted response with the job ID and volume ID.
    async handleCreateVolume(args: any) { const result = await this.cloudStackClient.createVolume(args); return { content: [ { type: 'text', text: `Created volume. Job ID: ${result.createvolumeresponse?.jobid}\nVolume ID: ${result.createvolumeresponse?.id}` } ] }; }
  • Defines the tool metadata including name, description, and input schema (parameters: name, diskofferingid, zoneid required; size optional).
    { name: 'create_volume', description: 'Create a new volume', inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Volume name', }, diskofferingid: { type: 'string', description: 'Disk offering ID', }, zoneid: { type: 'string', description: 'Zone ID', }, size: { type: 'number', description: 'Volume size in GB (for custom disk offerings)', }, }, required: ['name', 'diskofferingid', 'zoneid'], additionalProperties: false, }, },
  • src/server.ts:136-137 (registration)
    Registers the 'create_volume' tool in the MCP server's CallToolRequestHandler by dispatching to the StorageHandlers.handleCreateVolume method.
    case 'create_volume': return await this.storageHandlers.handleCreateVolume(args);
  • Helper method in CloudStackClient that makes the actual 'createVolume' API request to the CloudStack server, invoked by the tool handler.
    async createVolume(params: CloudStackParams): Promise<CloudStackResponse> { return this.request('createVolume', 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