Skip to main content
Glama

set_vm_display

Toggle dynamic resolution on a stopped virtual machine to adjust display scaling automatically.

Instructions

Toggle dynamic resolution on the VM display.

Args: name: VM name (must be stopped) dynamic_resolution: Enable or disable dynamic resolution

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
dynamic_resolutionYes

Implementation Reference

  • Core implementation of set_vm_display. Builds an AppleScript that toggles dynamic resolution on the first display of a stopped UTM VM and updates the configuration.
    def set_vm_display(name: str, dynamic_resolution: bool) -> bool:
        """Toggle dynamic resolution on the first display of a stopped VM."""
        _validate_vm_name(name)
        val = "true" if dynamic_resolution else "false"
        script = f'''
        tell application "UTM"
            set vm to virtual machine named "{_esc(name)}"
            set conf to configuration of vm
            set disps to displays of conf
            if (count of disps) > 0 then
                set dynamic resolution of item 1 of disps to {val}
                update configuration of vm with conf
            end if
        end tell
        '''
        _run(script)
        return True
  • MCP tool decorator that defines the server-facing schema for set_vm_display. Accepts 'name' (str) and 'dynamic_resolution' (bool) parameters and returns a dict.
    @mcp.tool()
    def set_vm_display(name: str, dynamic_resolution: bool) -> dict:
        """Toggle dynamic resolution on the VM display.
    
        Args:
            name: VM name (must be stopped)
            dynamic_resolution: Enable or disable dynamic resolution
        """
        utm.set_vm_display(name, dynamic_resolution)
        return {"name": name, "dynamic_resolution": dynamic_resolution}
  • The @mcp.tool() decorator registers 'set_vm_display' as an MCP tool in the server.
    @mcp.tool()
    def set_vm_display(name: str, dynamic_resolution: bool) -> dict:
        """Toggle dynamic resolution on the VM display.
    
        Args:
            name: VM name (must be stopped)
            dynamic_resolution: Enable or disable dynamic resolution
        """
        utm.set_vm_display(name, dynamic_resolution)
        return {"name": name, "dynamic_resolution": dynamic_resolution}
  • Validation test that confirms 'set_vm_display' is listed among expected tool names in the MCP server registry.
    def test_expected_tools(self):
        names = {t.name for t in mcp._tool_manager.list_tools()}
        expected = {
            "list_vms", "get_vm", "clone_vm", "start_vm", "stop_vm", "delete_vm",
            "suspend_vm", "wait_for_vm", "get_vm_ip", "set_vm_network",
            "set_vm_resources", "rename_vm", "set_vm_display", "list_vm_shares",
            "add_vm_share", "remove_vm_share", "set_vm_shares", "list_vm_drives",
            "attach_drive", "export_vm", "import_vm", "get_serial_port",
        }
        assert expected == names
Behavior2/5

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

No annotations are provided, so the description bears full responsibility. It states the precondition, but fails to detail what happens during the toggle, error conditions, or side effects. The description is minimal.

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 concise: a single action line followed by clear parameter definitions. No unnecessary words, and the most important information is front-loaded.

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 simplicity of the tool (2 parameters, no output schema), the description is mostly adequate but lacks details on return values, error handling, or prerequisites beyond the VM state. Sibling tools are not differentiated aside from the action.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/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 adds significant value. It explains both parameters: name is the VM name (with a constraint), and dynamic_resolution explicitly says 'Enable or disable dynamic resolution,' which clarifies the boolean's role.

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?

The description explicitly states the action: 'Toggle dynamic resolution on the VM display,' which is a specific verb and resource. It clearly distinguishes from sibling tools, none of which involve display settings.

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?

The description provides a crucial precondition: the VM must be stopped ('name: VM name (must be stopped)'). However, it does not mention when not to use this tool, or suggest alternatives, leaving some ambiguity.

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/neverprepared/mcp-utm'

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