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); }

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