start_virtual_machine
Use this tool to initiate the startup of a virtual machine by specifying its unique VM ID, enabling resource activation within the CloudStack MCP Server environment.
Instructions
Start a virtual machine
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"id": "<id>"
},
"name": "start_virtual_machine"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | VM ID to start |
Implementation Reference
- The main handler function that executes the start_virtual_machine tool logic. It calls the CloudStack client to start the VM and returns a formatted response with the job ID.
async handleStartVirtualMachine(args: any) { const result = await this.cloudStackClient.startVirtualMachine({ id: args.id }); return { content: [ { type: 'text', text: `Started virtual machine ${args.id}. Job ID: ${result.startvirtualmachineresponse?.jobid}` } ] }; } - The tool definition including name, description, and input schema that requires a 'id' parameter.
{ name: 'start_virtual_machine', description: 'Start a virtual machine', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'VM ID to start', }, }, required: ['id'], additionalProperties: false, }, }, - src/server.ts:112-113 (registration)Tool registration in the MCP server's CallToolRequest handler switch statement, which dispatches to the VirtualMachineHandlers.handleStartVirtualMachine method.
case 'start_virtual_machine': return await this.vmHandlers.handleStartVirtualMachine(args); - src/cloudstack-client.ts:100-102 (helper)Helper method in CloudStackClient that performs the actual API request to CloudStack's startVirtualMachine endpoint.
async startVirtualMachine(params: CloudStackParams): Promise<CloudStackResponse> { return this.request('startVirtualMachine', params); }