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);
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'List templates' implies a read-only operation, but it doesn't specify whether this requires authentication, what permissions are needed, if there are rate limits, pagination behavior, or what the output format looks like. For a tool with zero annotation coverage, this leaves critical behavioral traits undocumented.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise at just two words, with zero wasted language. It is front-loaded with the core action, though this brevity comes at the cost of clarity and completeness. Every word earns its place, but there are too few words to be helpful.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete for a tool with three parameters. It fails to explain the purpose, usage context, or behavioral traits, leaving significant gaps. While the schema covers parameters well, the overall context for tool selection and invocation is inadequate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with clear documentation for all three parameters (hypervisor, templatefilter, zoneid), including a default value and allowed values for templatefilter. The description adds no parameter semantics beyond what the schema already provides, so it meets the baseline score of 3 for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose2/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'List templates' is a tautology that merely restates the tool name without adding any meaningful context. It doesn't specify what kind of templates (VM templates, configuration templates, etc.) or what scope (all templates, filtered templates). While it includes the verb 'list,' it lacks the specificity needed to distinguish this tool from other list_* siblings in the server.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. There are multiple list_* tools in the sibling list (e.g., list_virtual_machines, list_volumes), but no indication is given about how list_templates differs or when it should be selected. No context, exclusions, or prerequisites are mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

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