Skip to main content
Glama
phantosmax

CloudStack MCP Server

by phantosmax

attach_volume

Link a storage volume to a virtual machine using Volume ID and VM ID on the CloudStack MCP Server, enabling efficient resource management and storage allocation.

Instructions

Attach volume to virtual machine

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
deviceidNoDevice ID
idYesVolume ID
virtualmachineidYesVM ID to attach to

Implementation Reference

  • The handler function that executes the attach_volume tool logic by calling the CloudStack client to attach the volume and returning a formatted success message.
    async handleAttachVolume(args: any) {
      const result = await this.cloudStackClient.attachVolume(args);
      
      return {
        content: [
          {
            type: 'text',
            text: `Attached volume ${args.id} to VM ${args.virtualmachineid}. Job ID: ${result.attachvolumeresponse?.jobid}`
          }
        ]
      };
    }
  • Defines the tool name, description, and input schema (parameters with types and requirements) for attach_volume.
    {
      name: 'attach_volume',
      description: 'Attach volume to virtual machine',
      inputSchema: {
        type: 'object',
        properties: {
          id: {
            type: 'string',
            description: 'Volume ID',
          },
          virtualmachineid: {
            type: 'string',
            description: 'VM ID to attach to',
          },
          deviceid: {
            type: 'number',
            description: 'Device ID',
          },
        },
        required: ['id', 'virtualmachineid'],
        additionalProperties: false,
      },
    },
  • src/server.ts:138-139 (registration)
    Registers and dispatches the attach_volume tool call to the corresponding storage handler method.
    case 'attach_volume':
      return await this.storageHandlers.handleAttachVolume(args);
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 the action but doesn't describe what happens during attachment (e.g., whether the VM needs to be stopped, if data persists, potential downtime, or error conditions). For a mutation tool with zero annotation coverage, this leaves significant gaps in understanding the tool's behavior.

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 with the core action and resources, making it immediately understandable without unnecessary elaboration.

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?

For a mutation tool with no annotations and no output schema, the description is insufficient. It doesn't explain what the tool returns, error conditions, side effects, or operational constraints. Given the complexity of attaching storage volumes in cloud environments, more context is needed for safe and effective 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?

Schema description coverage is 100%, so the schema already documents all three parameters (deviceid, id, virtualmachineid) with basic descriptions. The description doesn't add any additional meaning about parameter usage, relationships, or constraints beyond what's in the schema, meeting the baseline for high 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 action ('Attach') and target resources ('volume to virtual machine'), providing a specific verb+resource combination. It distinguishes from sibling tools like 'detach_volume' by specifying the opposite operation, though it doesn't explicitly mention all sibling differences.

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 about when to use this tool versus alternatives. While the name implies it's for attaching volumes, there's no mention of prerequisites (e.g., volume must be detached, VM must be stopped), constraints, or comparison with related tools like 'create_volume' or 'detach_volume'.

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