Skip to main content
Glama
phantosmax

CloudStack MCP Server

by phantosmax

list_snapshots

Retrieve and filter volume snapshots by volume ID and interval type (e.g., MANUAL, HOURLY, DAILY) for effective snapshot management on CloudStack MCP Server.

Instructions

List volume snapshots

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
intervaltypeNoInterval type (MANUAL, HOURLY, DAILY, WEEKLY, MONTHLY)
volumeidNoVolume ID to filter snapshots

Implementation Reference

  • The handler function that implements the core logic for the 'list_snapshots' tool. It calls the CloudStack client to list snapshots, processes the response, and formats it as a text response.
    async handleListSnapshots(args: any) { const result = await this.cloudStackClient.listSnapshots(args); const snapshots = result.listsnapshotsresponse?.snapshot || []; const snapshotList = snapshots.map((snapshot: any) => ({ id: snapshot.id, name: snapshot.name, state: snapshot.state, volumeid: snapshot.volumeid, intervaltype: snapshot.intervaltype, created: snapshot.created, snapshottype: snapshot.snapshottype })); return { content: [ { type: 'text', text: `Found ${snapshotList.length} snapshots:\n\n${snapshotList .map((snap: any) => `• ${snap.name} (${snap.id})\n State: ${snap.state}\n Volume ID: ${snap.volumeid}\n Type: ${snap.snapshottype}\n Interval: ${snap.intervaltype}\n Created: ${snap.created}\n` ) .join('\n')}` } ] }; }
  • The tool definition including name, description, and input schema for 'list_snapshots'.
    { name: 'list_snapshots', description: 'List volume snapshots', inputSchema: { type: 'object', properties: { volumeid: { type: 'string', description: 'Volume ID to filter snapshots', }, intervaltype: { type: 'string', description: 'Interval type (MANUAL, HOURLY, DAILY, WEEKLY, MONTHLY)', }, }, additionalProperties: false, }, },
  • src/server.ts:146-147 (registration)
    Dispatch/registration in the MCP server switch statement that routes 'list_snapshots' calls to the storage handler.
    case 'list_snapshots': return await this.storageHandlers.handleListSnapshots(args);
  • Supporting CloudStack client method that performs the actual API request to list snapshots.
    async listSnapshots(params: CloudStackParams = {}): Promise<CloudStackResponse> { return this.request('listSnapshots', 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