change_service_offering_virtual_machine
Modify the service offering for a virtual machine in CloudStack by specifying the VM ID and new service offering ID.
Instructions
Change service offering for 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>",
"serviceofferingid": "<serviceofferingid>"
},
"name": "change_service_offering_virtual_machine"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | VM ID | |
| serviceofferingid | Yes | New service offering ID |
Implementation Reference
- The main handler function that implements the tool logic by calling the CloudStack API to change the service offering for the specified virtual machine.
async handleChangeServiceOfferingVirtualMachine(args: any) { const result = await this.cloudStackClient.changeServiceForVirtualMachine({ id: args.id, serviceofferingid: args.serviceofferingid }); return { content: [ { type: 'text', text: `Changed service offering for virtual machine ${args.id}. Job ID: ${result.changeserviceforvirtualmachineresponse?.jobid}` } ] }; } - Tool definition with input schema for validating the required parameters: VM ID and new service offering ID.
{ name: 'change_service_offering_virtual_machine', description: 'Change service offering for virtual machine', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'VM ID', }, serviceofferingid: { type: 'string', description: 'New service offering ID', }, }, required: ['id', 'serviceofferingid'], additionalProperties: false, }, }, - src/server.ts:128-129 (registration)Switch case in the tool dispatch handler that routes calls to this tool to the VirtualMachineHandlers instance.
case 'change_service_offering_virtual_machine': return await this.vmHandlers.handleChangeServiceOfferingVirtualMachine(args);