Skip to main content
Glama
yeahdongcn

VMware Fusion MCP Server

by yeahdongcn

get_vm_power_state

Check the current power status of a VMware Fusion virtual machine to determine if it's running, powered off, or suspended.

Instructions

Get the power state of a specific VM.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
vm_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler implementation that creates a VMwareClient instance and calls its get_vm_power_state method to retrieve the VM power state.
    async def _get_vm_power_state_impl(vm_id: str) -> Dict[str, Any]:
        """Get the power state of a specific VM."""
        async with VMwareClient(username=VMREST_USER, password=VMREST_PASS) as client:
            state = await client.get_vm_power_state(vm_id)
            return state  # type: ignore[no-any-return]
  • Registers the 'get_vm_power_state' tool with the MCP server via @mcp.tool decorator. The tool handler delegates execution to the private implementation function.
    @mcp.tool
    async def get_vm_power_state(vm_id: str) -> Dict[str, Any]:
        """Get the power state of a specific VM."""
        return await _get_vm_power_state_impl(vm_id)
  • Supporting utility in VMwareClient class that performs the HTTP GET request to the Fusion REST API endpoint /api/vms/{vm_id}/power to obtain the power state.
    async def get_vm_power_state(
        self, vm_id: str, vm_password: Optional[str] = None
    ) -> Dict[str, Any]:
        """Get the power state of a specific VM.
    
        Args:
            vm_id: The ID of the VM
            vm_password: The password for the VM (if required)
    
        Returns:
            Dictionary with the VM's power state
        """
        try:
            url = f"{self.base_url}/api/vms/{vm_id}/power"
            params = {}
            if vm_password:
                params["vmPassword"] = vm_password
            response = await self._client.get(
                url,
                headers=self._auth_header,
                params=params or None,
            )
            response.raise_for_status()
            return response.json()  # type: ignore[no-any-return]
        except httpx.RequestError as e:
            raise Exception(f"Failed to connect to VMware Fusion API: {e}")
        except httpx.HTTPStatusError as e:
            if e.response.status_code == 404:
                raise Exception(f"VM with ID '{vm_id}' not found")
            raise Exception(
                f"VMware Fusion API error: {e.response.status_code} - "
                f"{e.response.text}"
            )
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool gets power state, implying a read-only operation, but doesn't specify if it requires authentication, has rate limits, returns specific error conditions, or details the output format. This leaves significant gaps in understanding the tool's behavior beyond the basic purpose.

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?

The description is a single, clear sentence with no wasted words. It's front-loaded with the core purpose and efficiently conveys the essential information without unnecessary elaboration, making it highly concise and well-structured.

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

Completeness3/5

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

Given the tool's low complexity (1 parameter, no nested objects) and the presence of an output schema (which should document return values), the description is minimally adequate. However, it lacks context on usage guidelines and behavioral details, which are important for a tool that interacts with system resources like VMs, leaving room for improvement.

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?

The input schema has 0% description coverage, so the description must compensate. It mentions 'a specific VM', which implies the 'vm_id' parameter identifies the VM, but doesn't clarify the ID format, source, or constraints. This adds minimal semantic value beyond what the schema's title ('Vm Id') suggests, meeting the baseline for low schema coverage.

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

Purpose4/5

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

The description clearly states the verb ('Get') and resource ('power state of a specific VM'), making the purpose unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'get_vm_info' (which might include power state among other details) or 'list_vms' (which lists VMs rather than querying a specific one's state), so it doesn't reach the highest score.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'get_vm_info' (which might retrieve power state along with other info) or 'power_vm' (which changes power state), leaving the agent to infer usage context without explicit direction.

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/yeahdongcn/vmware-fusion-mcp-server'

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