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
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | VM ID |
Input Schema (JSON Schema)
{
"additionalProperties": false,
"properties": {
"id": {
"description": "VM ID",
"type": "string"
}
},
"required": [
"id"
],
"type": "object"
}
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);