Skip to main content
Glama
phantosmax

CloudStack MCP Server

by phantosmax

list_usage_records

Retrieve billing usage records from CloudStack MCP Server by specifying a start date, end date, and optional usage type for accurate cost tracking and analysis.

Instructions

List usage records for billing

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
enddateYesEnd date (YYYY-MM-DD)
startdateYesStart date (YYYY-MM-DD)
typeNoUsage type

Implementation Reference

  • Main handler function that fetches usage records from CloudStack, processes them, and formats a response with details like usageid, description, usagetype, usage, startdate, enddate.
    async handleListUsageRecords(args: any) {
      const result = await this.cloudStackClient.listUsageRecords(args);
      const records = result.listusagerecordsresponse?.usagerecord || [];
      
      const recordList = records.map((record: any) => ({
        usageid: record.usageid,
        description: record.description,
        usagetype: record.usagetype,
        rawusage: record.rawusage,
        usage: record.usage,
        startdate: record.startdate,
        enddate: record.enddate
      }));
    
      return {
        content: [
          {
            type: 'text',
            text: `Found ${recordList.length} usage records:\n\n${recordList
              .map((record: any) => 
                `• ${record.description} (${record.usageid})\n  Type: ${record.usagetype}\n  Usage: ${record.usage}\n  Start: ${record.startdate}\n  End: ${record.enddate}\n`
              )
              .join('\n')}`
          }
        ]
      };
    }
  • Tool definition including name, description, and input schema requiring startdate and enddate, with optional type.
      name: 'list_usage_records',
      description: 'List usage records for billing',
      inputSchema: {
        type: 'object',
        properties: {
          startdate: {
            type: 'string',
            description: 'Start date (YYYY-MM-DD)',
          },
          enddate: {
            type: 'string',
            description: 'End date (YYYY-MM-DD)',
          },
          type: {
            type: 'number',
            description: 'Usage type',
          },
        },
        required: ['startdate', 'enddate'],
        additionalProperties: false,
      },
    },
  • src/server.ts:174-175 (registration)
    Switch case in server that registers and dispatches the tool call to the monitoring handler.
    case 'list_usage_records':
      return await this.monitoringHandlers.handleListUsageRecords(args);
  • CloudStack client method that makes the actual API request to listUsageRecords endpoint.
    async listUsageRecords(params: CloudStackParams): Promise<CloudStackResponse> {
      return this.request('listUsageRecords', params);
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states it's a list operation, implying read-only behavior, but doesn't clarify permissions, rate limits, pagination, or output format. For a tool with billing data, this lack of detail on sensitivity or access constraints is a significant gap.

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 zero wasted words. It's front-loaded with the core purpose and avoids unnecessary elaboration, making it easy for an agent 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 the complexity of billing data and lack of annotations or output schema, the description is insufficient. It doesn't explain what 'usage records' include, how results are structured, or any behavioral traits like error handling. For a tool with potential financial implications, more context is needed.

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, clearly documenting all three parameters (startdate, enddate, type) with formats and requirements. The description adds no additional parameter semantics beyond implying date-range filtering for billing records. This meets the baseline for high schema coverage.

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

Purpose4/5

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

The description clearly states the verb ('List') and resource ('usage records for billing'), making the purpose unambiguous. It distinguishes itself from siblings by focusing on billing-related usage records rather than infrastructure components like virtual machines or networks. However, it doesn't specify the exact scope or format of the listing, keeping it from a perfect score.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, context for billing analysis, or how it differs from other list tools like list_events or list_accounts. The agent must infer usage from the name and parameters alone.

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