Skip to main content
Glama
phantosmax

CloudStack MCP Server

by phantosmax

list_capacity

Retrieve system capacity details including memory, CPU, and storage for specific zones using CloudStack MCP Server's query tool.

Instructions

List system capacity information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeNoCapacity type (0=Memory, 1=CPU, 2=Storage, etc.)
zoneidNoZone ID to filter capacity

Implementation Reference

  • The main handler function that executes the list_capacity tool logic by calling the CloudStack client, processing capacities, and formatting a text response.
    async handleListCapacity(args: any) {
      const result = await this.cloudStackClient.listCapacity(args);
      const capacities = result.listcapacityresponse?.capacity || [];
      
      const capacityList = capacities.map((capacity: any) => ({
        type: capacity.type,
        zonename: capacity.zonename,
        capacityused: capacity.capacityused,
        capacitytotal: capacity.capacitytotal,
        percentused: capacity.percentused
      }));
    
      return {
        content: [
          {
            type: 'text',
            text: `Found ${capacityList.length} capacity metrics:\n\n${capacityList
              .map((cap: any) => 
                `• Type: ${cap.type}\n  Zone: ${cap.zonename}\n  Used: ${cap.capacityused}\n  Total: ${cap.capacitytotal}\n  Percent Used: ${cap.percentused}%\n`
              )
              .join('\n')}`
          }
        ]
      };
    }
  • Defines the tool name, description, and input schema for validation in the MCP tool definitions.
      name: 'list_capacity',
      description: 'List system capacity information',
      inputSchema: {
        type: 'object',
        properties: {
          zoneid: {
            type: 'string',
            description: 'Zone ID to filter capacity',
          },
          type: {
            type: 'number',
            description: 'Capacity type (0=Memory, 1=CPU, 2=Storage, etc.)',
          },
        },
        additionalProperties: false,
      },
    },
  • src/server.ts:170-171 (registration)
    Dispatches the list_capacity tool call to the appropriate monitoring handler in the MCP server request handler.
    case 'list_capacity':
      return await this.monitoringHandlers.handleListCapacity(args);
  • Helper method in the CloudStack client that performs the actual API request to listCapacity.
    async listCapacity(params: CloudStackParams = {}): Promise<CloudStackResponse> {
      return this.request('listCapacity', params);
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states 'List system capacity information', implying a read-only operation, but doesn't disclose behavioral traits such as authentication requirements, rate limits, pagination, or what the output format looks like (e.g., JSON structure, units). This is a significant gap for a tool with no annotation coverage.

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 a single, efficient sentence with no wasted words. It's front-loaded and appropriately sized for a simple listing tool, making it easy to parse quickly.

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 no annotations and no output schema, the description is incomplete. It doesn't explain what 'capacity information' includes (e.g., metrics, units), how results are structured, or any prerequisites. For a tool in a complex system with many siblings, this leaves too much ambiguity for effective agent use.

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 'type' and 'zoneid' parameters. The description adds no additional semantic meaning beyond the schema, such as explaining how these parameters affect the listing (e.g., filtering logic). Baseline 3 is appropriate since the schema does the heavy lifting.

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

Purpose3/5

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

The description 'List system capacity information' clearly states the action (list) and resource (system capacity information), which is adequate. However, it lacks specificity about what 'capacity information' entails (e.g., metrics, limits, usage) and doesn't differentiate from siblings like 'list_storage_pools' or 'list_hosts' that might overlap in resource monitoring contexts.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives. With many sibling tools for listing resources (e.g., 'list_storage_pools', 'list_hosts'), the description doesn't clarify if this is for overall system metrics, capacity planning, or filtering specific types, leaving usage context ambiguous.

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