resize_volume
Increase or decrease the size of a volume in CloudStack MCP Server by specifying the Volume ID and desired size in GB. Optionally allow shrinking for reduced storage needs.
Instructions
Resize a volume
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Volume ID | |
| shrinkok | No | Allow shrinking | |
| size | Yes | New size in GB |
Implementation Reference
- src/handlers/storage-handlers.ts:77-88 (handler)The main handler function that executes the resize_volume tool by calling the CloudStack client and formatting the response.async handleResizeVolume(args: any) { const result = await this.cloudStackClient.resizeVolume(args); return { content: [ { type: 'text', text: `Resized volume ${args.id}. Job ID: ${result.resizevolumeresponse?.jobid}` } ] }; }
- Defines the tool metadata including name, description, and input schema for resize_volume.{ name: 'resize_volume', description: 'Resize a volume', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Volume ID', }, size: { type: 'number', description: 'New size in GB', }, shrinkok: { type: 'boolean', description: 'Allow shrinking', default: false, }, }, required: ['id', 'size'], additionalProperties: false, }, },
- src/server.ts:142-143 (registration)Registers the resize_volume tool in the MCP server by dispatching tool calls to the storage handler.case 'resize_volume': return await this.storageHandlers.handleResizeVolume(args);
- src/cloudstack-client.ts:176-178 (helper)Low-level wrapper method that sends the resizeVolume command to the CloudStack API.async resizeVolume(params: CloudStackParams): Promise<CloudStackResponse> { return this.request('resizeVolume', params); }