Skip to main content
Glama
yeahdongcn

VMware Fusion MCP Server

by yeahdongcn

get_vm_info

Retrieve detailed information about a specific VMware Fusion virtual machine, including configuration and status, by providing its VM ID.

Instructions

Get detailed information about a specific VM.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
vm_idYes

Implementation Reference

  • The primary MCP tool handler for 'get_vm_info', registered via @mcp.tool decorator. It delegates to the internal implementation.
    @mcp.tool
    async def get_vm_info(vm_id: str) -> Dict[str, Any]:
        """Get detailed information about a specific VM."""
        return await _get_vm_info_impl(vm_id)
  • Internal helper function that instantiates VMwareClient and calls its get_vm_info method to fetch VM details.
    async def _get_vm_info_impl(vm_id: str) -> Dict[str, Any]:
        """Get detailed information about a specific VM."""
        async with VMwareClient(username=VMREST_USER, password=VMREST_PASS) as client:
            info = await client.get_vm_info(vm_id)
            return info  # type: ignore[no-any-return]
  • Core implementation in VMwareClient that makes HTTP GET request to VMware Fusion REST API endpoint `/api/vms/{vm_id}` to retrieve VM information.
    async def get_vm_info(
        self, vm_id: str, vm_password: Optional[str] = None
    ) -> Dict[str, Any]:
        """Get detailed information about a specific VM.
    
        Args:
            vm_id: The ID of the VM
            vm_password: The password for the VM (if required)
    
        Returns:
            Dictionary with detailed VM information
        """
        try:
            url = f"{self.base_url}/api/vms/{vm_id}"
            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()
            result: Dict[str, Any] = response.json()
            return result
        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}"
            )

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