Skip to main content
Glama
jkmills

Nutanix MCP Server

by jkmills

power_off_vm

Power off a VM using ACPI shutdown, or force immediate hard shutdown.

Instructions

Power off a virtual machine. Uses ACPI shutdown by default (guest-initiated).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
vm_uuidYesThe UUID (extId) of the virtual machine
forceNoForce power off (hard shutdown) instead of ACPI guest shutdown

Implementation Reference

  • Tool definition (schema) for 'power_off_vm' with vm_uuid and optional force boolean parameters.
    {
        "name": "power_off_vm",
        "description": (
            "Power off a virtual machine. Uses ACPI shutdown by default (guest-initiated)."
        ),
        "inputSchema": {
            "type": "object",
            "properties": {
                "vm_uuid": {
                    "type": "string",
                    "description": "The UUID (extId) of the virtual machine",
                },
                "force": {
                    "type": "boolean",
                    "description": "Force power off (hard shutdown) instead of ACPI guest shutdown",
                    "default": False,
                },
            },
            "required": ["vm_uuid"],
        },
    },
  • Handler function for power_off_vm. Posts to v4 API with either 'guest-shutdown' (ACPI, default) or 'power-off' (hard) action based on force parameter.
    async def handle_power_off_vm(
        client: NutanixClient, arguments: dict[str, Any]
    ) -> dict[str, Any]:
        """Power off a VM using v4 vmm API."""
        vm_uuid = arguments["vm_uuid"]
        force = arguments.get("force", False)
    
        action = "power-off" if force else "guest-shutdown"
        result = await client.v4_post(
            namespace="vmm",
            path=f"ahv/config/vms/{vm_uuid}/$actions/{action}",
            body={},
        )
        return {"status": f"{action}_initiated", "taskExtId": result.get("data", {}).get("extId")}
  • Handler dispatch table mapping 'power_off_vm' string to handle_power_off_vm function.
    VM_HANDLERS: dict[str, Any] = {
        "list_vms": handle_list_vms,
        "get_vm": handle_get_vm,
        "power_on_vm": handle_power_on_vm,
        "power_off_vm": handle_power_off_vm,
        "create_vm": handle_create_vm,
    }
  • Merged ALL_HANDLERS dict that includes VM_HANDLERS (containing power_off_vm) used by the MCP server's call_tool handler.
    ALL_HANDLERS: dict[str, Any] = {
        **VM_HANDLERS,
        **CLUSTER_HANDLERS,
        **PE_HANDLERS,
        **REPORT_HANDLERS,
        **NETWORKING_HANDLERS,
    }
  • NutanixClient.v4_post() - the low-level HTTP POST helper used by handle_power_off_vm to call the Nutanix v4 API with retry logic.
    async def v4_post(
        self,
        namespace: str,
        path: str,
        body: dict[str, Any],
        params: Optional[dict[str, str]] = None,
    ) -> dict[str, Any]:
        """POST request against v4 API."""
        client = await self._get_client()
        url = f"/{namespace}/{self.V4_VERSION}/{path}"
    
        for attempt in range(self.MAX_RETRIES + 1):
            try:
                response = await client.post(url, json=body, params=params)
            except httpx.ConnectError as e:
                raise NutanixAPIError(
                    f"Connection failed to {self.settings.host}:{self.settings.port}",
                    details=str(e),
                )
            except httpx.TimeoutException as e:
                raise NutanixAPIError(
                    f"Request timed out after {self.settings.timeout}s",
                    details=str(e),
                )
    
            if response.status_code == 429 and attempt < self.MAX_RETRIES:
                wait = self.RETRY_BACKOFF_BASE * (2 ** attempt)
                await asyncio.sleep(wait)
                continue
    
            if response.status_code >= 400:
                self._handle_error(response)
    
            return response.json()
    
        self._handle_error(response)
        return {}  # unreachable
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full burden. Discloses default ACPI shutdown and force option. However, does not describe behavior if VM is already off, whether call is async/sync, or any side effects beyond the action.

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?

Two short sentences, front-loaded with purpose, no extraneous words. Highly efficient and easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple tool with 2 params and no output schema, the description covers the core action and default behavior. Missing edge cases (e.g., VM off state) but overall sufficient given tool simplicity.

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 coverage is 100%, so baseline is 3. Description reinforces meaning of force param by stating default ACPI shutdown, but adds no new semantic beyond schema definitions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states it powers off a VM, with specific verb and resource. Distinguishes from sibling 'power_on_vm' by opposite action. Also mentions default shutdown method, adding precision.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Only describes what the tool does, not when to use or when to avoid. No explicit context for alternative tools (e.g., when to use force vs default, or prerequisites like VM state). Minimal guidance.

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

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/jkmills/nutanix-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server