Skip to main content
Glama
phantosmax

CloudStack MCP Server

by phantosmax

list_domains

Retrieve domain details in an Apache CloudStack environment by specifying domain level or name using the MCP-enabled server tool for efficient cloud resource management.

Instructions

List domains

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
levelNoDomain level
nameNoDomain name

Implementation Reference

  • The handler function that implements the core logic for the 'list_domains' tool. It queries the CloudStack client for domains, processes the response, formats it into a readable list, and returns it in the MCP content format.
    async handleListDomains(args: any) {
      const result = await this.cloudStackClient.listDomains(args);
      const domains = result.listdomainsresponse?.domain || [];
      
      const domainList = domains.map((domain: any) => ({
        id: domain.id,
        name: domain.name,
        path: domain.path,
        level: domain.level,
        parentdomainid: domain.parentdomainid,
        parentdomainname: domain.parentdomainname,
        haschild: domain.haschild,
        state: domain.state
      }));
    
      return {
        content: [
          {
            type: 'text',
            text: `Found ${domainList.length} domains:\n\n${domainList
              .map((domain: any) => 
                `• ${domain.name} (${domain.id})\n  Path: ${domain.path}\n  Level: ${domain.level}\n  Parent: ${domain.parentdomainname || 'None'}\n  Has Children: ${domain.haschild}\n  State: ${domain.state}\n`
              )
              .join('\n')}`
          }
        ]
      };
    }
  • The tool definition including name, description, and input schema for 'list_domains', which specifies optional parameters for filtering domains by level or name.
      name: 'list_domains',
      description: 'List domains',
      inputSchema: {
        type: 'object',
        properties: {
          level: {
            type: 'number',
            description: 'Domain level',
          },
          name: {
            type: 'string',
            description: 'Domain name',
          },
        },
        additionalProperties: false,
      },
    },
  • src/server.ts:186-187 (registration)
    The dispatch case in the CallToolRequest handler that registers and routes calls to the 'list_domains' tool to its specific handler method.
    case 'list_domains':
      return await this.adminHandlers.handleListDomains(args);
  • Supporting method in the CloudStack client that makes the underlying API request to 'listDomains' endpoint.
    async listDomains(params: CloudStackParams = {}): Promise<CloudStackResponse> {
      return this.request('listDomains', params);
    }
Behavior1/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 domains' gives no indication of whether this is a read-only operation, what permissions might be required, whether it's paginated or returns all results at once, or any error conditions. For a tool with no annotation coverage, this description fails to provide essential behavioral context that would help an agent invoke it correctly.

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—just two words—and front-loaded with the core action. There's no wasted language or unnecessary elaboration. While this conciseness comes at the cost of completeness, it efficiently communicates the basic intent without verbosity.

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

Completeness1/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 parameters. It doesn't explain what 'domains' refers to in this context, what the tool returns, or any behavioral aspects. For a list operation with filtering parameters, this minimal description leaves too many open questions for effective use by an AI agent.

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 both parameters ('level' and 'name'). The description adds no additional information about these parameters, such as example values, constraints, or how they interact. Since the schema already does the heavy lifting, the baseline score of 3 is appropriate—the description neither compensates for gaps nor adds value beyond the schema.

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 domains' is a tautology that merely restates the tool name without adding any meaningful context. It doesn't specify what kind of domains (e.g., network domains, DNS domains, organizational domains) or what scope is involved. While it does include a verb ('List') and resource ('domains'), it lacks the specificity needed to distinguish this tool from potential alternatives or clarify its exact function beyond the obvious.

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. It doesn't mention any prerequisites, context for usage, or relationship to sibling tools (e.g., other 'list_' tools like list_networks or list_users). Without this information, an AI agent would have to infer usage from the tool name alone, which is insufficient for informed decision-making.

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