Skip to main content
Glama

attach_drive

Attach an ISO or disk image file to a specific drive of a stopped UTM virtual machine to enable booting from external media or accessing additional storage.

Instructions

Attach an ISO or disk image to a removable drive.

Args: name: VM name (must be stopped) drive_id: Drive ID (from list_vm_drives) source_path: Path to ISO or disk image file

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
drive_idYes
source_pathYes

Implementation Reference

  • MCP tool handler that exposes attach_drive as a tool, calls applescript.attach_drive and returns a dict result.
    def attach_drive(name: str, drive_id: str, source_path: str) -> dict:
        """Attach an ISO or disk image to a removable drive.
    
        Args:
            name: VM name (must be stopped)
            drive_id: Drive ID (from list_vm_drives)
            source_path: Path to ISO or disk image file
        """
        utm.attach_drive(name, drive_id, source_path)
        return {"name": name, "drive_id": drive_id, "source": source_path}
  • Tool registered via @mcp.tool() decorator on FastMCP instance.
    @mcp.tool()
    def attach_drive(name: str, drive_id: str, source_path: str) -> dict:
  • AppleScript implementation that attaches an ISO/disk image to a removable drive by updating the UTM VM configuration via AppleScript.
    def attach_drive(name: str, drive_id: str, source_path: str) -> bool:
        """Attach an ISO or disk image to a removable drive on a stopped VM."""
        _validate_vm_name(name)
        _validate_path(source_path)
        script = f'''
        tell application "UTM"
            set vm to virtual machine named "{_esc(name)}"
            set conf to configuration of vm
            set drvs to drives of conf
            repeat with i from 1 to count of drvs
                set d to item i of drvs
                if id of d is "{_esc(drive_id)}" then
                    set source of d to POSIX file "{_esc(source_path)}"
                    exit repeat
                end if
            end repeat
            update configuration of vm with conf
        end tell
        '''
        _run(script)
        return True
  • Function signature and docstring define the schema: name (str), drive_id (str), source_path (str) -> dict.
    """Attach an ISO or disk image to a removable drive.
    
    Args:
        name: VM name (must be stopped)
        drive_id: Drive ID (from list_vm_drives)
        source_path: Path to ISO or disk image file
    """
Behavior3/5

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

The description discloses the precondition (VM must be stopped) and references list_vm_drives for the drive_id, but does not explain side effects, error behavior, or what happens if conditions are not met. With no annotations, more detail would be beneficial.

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 with two sentences: first states the purpose, second lists parameters with arrow-notation explanations. No unnecessary words.

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?

Given no output schema and 3 required parameters, the description covers the main purpose, precondition, and parameter sources. Missing details like return value or error conditions, but overall sufficient for a simple attach operation.

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 0%, so the description must compensate. It provides brief meanings for each parameter (VM name, drive ID from list, source file path), but lacks format details or how to obtain values. This is adequate but not thorough.

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 clearly states 'Attach an ISO or disk image to a removable drive', using a specific verb and resource. This distinguishes it from sibling tools like add_vm_share or start_vm, which have different purposes.

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

Usage Guidelines4/5

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

The description includes a crucial precondition: 'name: VM name (must be stopped)', which guides usage. It does not explicitly mention alternatives, but the sibling tools are distinct, so no exclusion is needed.

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