Skip to main content
Glama
phantosmax

CloudStack MCP Server

by phantosmax

list_templates

Retrieve and filter templates from the CloudStack MCP Server by type, hypervisor, or zone, enabling efficient management of virtual machine configurations.

Instructions

List templates

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hypervisorNoHypervisor type
templatefilterYesTemplate filter (featured, self, selfexecutable, sharedexecutable, executable, community)featured
zoneidNoZone ID to filter templates

Implementation Reference

  • Main handler function that executes the list_templates tool logic: fetches templates via CloudStack client, processes them, and returns formatted text response.
    async handleListTemplates(args: any) { const result = await this.cloudStackClient.listTemplates(args); const templates = result.listtemplatesresponse?.template || []; const templateList = templates.map((template: any) => ({ id: template.id, name: template.name, displaytext: template.displaytext, ostypename: template.ostypename, size: template.size, created: template.created, isready: template.isready, ispublic: template.ispublic, isfeatured: template.isfeatured })); return { content: [ { type: 'text', text: `Found ${templateList.length} templates:\n\n${templateList .map((template: any) => `• ${template.name} (${template.id})\n Display Text: ${template.displaytext}\n OS Type: ${template.ostypename}\n Size: ${template.size}GB\n Ready: ${template.isready}\n Public: ${template.ispublic}\n Featured: ${template.isfeatured}\n Created: ${template.created}\n` ) .join('\n')}` } ] };
  • Input schema and definition for the list_templates tool.
    { name: 'list_templates', description: 'List templates', inputSchema: { type: 'object', properties: { templatefilter: { type: 'string', description: 'Template filter (featured, self, selfexecutable, sharedexecutable, executable, community)', default: 'featured', }, zoneid: { type: 'string', description: 'Zone ID to filter templates', }, hypervisor: { type: 'string', description: 'Hypervisor type', }, }, required: ['templatefilter'], additionalProperties: false, },
  • src/server.ts:180-181 (registration)
    Dispatch/registration in server switch statement mapping tool name to handler.
    case 'list_templates': return await this.adminHandlers.handleListTemplates(args);
  • Helper method in CloudStack client that sends the actual API request for listing templates.
    async listTemplates(params: CloudStackParams = {}): Promise<CloudStackResponse> { const defaultParams = { templatefilter: 'featured', ...params }; return this.request('listTemplates', defaultParams); }

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