reset_password_virtual_machine
Reset the password for a virtual machine by specifying its VM ID using this tool within the CloudStack MCP Server for streamlined cloud resource management.
Instructions
Reset password 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>"
},
"name": "reset_password_virtual_machine"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | VM ID |
Implementation Reference
- The core handler function that implements the tool logic by calling the CloudStack client to reset the VM password and returning a success message with job ID.
async handleResetPasswordVirtualMachine(args: any) { const result = await this.cloudStackClient.resetPasswordForVirtualMachine({ id: args.id }); return { content: [ { type: 'text', text: `Reset password for virtual machine ${args.id}. Job ID: ${result.resetpasswordforvirtualmachineresponse?.jobid}` } ] }; } - The tool definition including name, description, and input schema that validates the 'id' parameter.
name: 'reset_password_virtual_machine', description: 'Reset password for virtual machine', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'VM ID', }, }, required: ['id'], additionalProperties: false, }, }, - src/server.ts:126-127 (registration)Tool registration in the server dispatch logic, routing calls to the virtual machine handler.
case 'reset_password_virtual_machine': return await this.vmHandlers.handleResetPasswordVirtualMachine(args);