detach_volume
Detach a volume from a virtual machine in CloudStack MCP Server by specifying the Volume ID, enabling efficient storage management and resource optimization.
Instructions
Detach volume from virtual machine
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Volume ID |
Implementation Reference
- src/handlers/storage-handlers.ts:64-75 (handler)Executes the detach_volume tool by invoking the CloudStack client's detachVolume method with the volume ID from arguments and returns a formatted text response containing the job ID.async handleDetachVolume(args: any) { const result = await this.cloudStackClient.detachVolume({ id: args.id }); return { content: [ { type: 'text', text: `Detached volume ${args.id}. Job ID: ${result.detachvolumeresponse?.jobid}` } ] }; }
- Defines the input schema for the detach_volume tool, requiring a 'id' string parameter for the volume ID.{ name: 'detach_volume', description: 'Detach volume from virtual machine', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Volume ID', }, }, required: ['id'], additionalProperties: false, }, },
- src/server.ts:140-141 (registration)Registers the detach_volume tool in the MCP server by routing calls to the storageHandlers.handleDetachVolume method in the CallToolRequest handler.case 'detach_volume': return await this.storageHandlers.handleDetachVolume(args);
- src/cloudstack-client.ts:172-173 (helper)Helper method in CloudStackClient that performs the actual API request to the CloudStack detachVolume endpoint.async detachVolume(params: CloudStackParams): Promise<CloudStackResponse> { return this.request('detachVolume', params);