Skip to main content
Glama

stop_vm

Stop a running virtual machine. Use force to halt VMs that do not shut down gracefully.

Instructions

Stop a running VM.

Args: name: VM name force: Force stop if graceful shutdown fails

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
forceNo

Implementation Reference

  • MCP tool handler for stop_vm. Decorated with @mcp.tool(), delegates to utm.stop_vm (the applescript module).
    @mcp.tool()
    def stop_vm(name: str, force: bool = False) -> dict:
        """Stop a running VM.
    
        Args:
            name: VM name
            force: Force stop if graceful shutdown fails
        """
        status = utm.stop_vm(name, force=force)
        return {"name": name, "status": status}
  • Helper function that generates and runs AppleScript to stop a VM via UTM's scripting API. Supports graceful and force stop methods.
    def stop_vm(name: str, force: bool = False) -> str:
        """Stop a VM. Returns status after stop command."""
        _validate_vm_name(name)
        method = "by force" if force else ""
        script = f'''
        tell application "UTM"
            set vm to virtual machine named "{_esc(name)}"
            stop vm {method}
            return status of vm as text
        end tell
        '''
        return _run(script, timeout=60)
  • Tool registered via the @mcp.tool() decorator on the stop_vm handler function.
    @mcp.tool()
    def stop_vm(name: str, force: bool = False) -> dict:
  • Input schema: name (str) is required, force (bool, default False) is optional. Return type is dict.
    @mcp.tool()
    def stop_vm(name: str, force: bool = False) -> dict:
Behavior2/5

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

No annotations provided. Description lacks behavioral details such as state changes, reversibility, required permissions, or whether force stop is safe. Only basic stop action described.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Very concise, two sentences plus arg list. However, structure could be improved with bullet points or clearer separation of parameter descriptions.

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

Completeness2/5

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

No output schema, no annotations. Description does not cover return values, error handling, prerequisites, or post-conditions. For a simple action, still lacks completeness.

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%, but description explains both parameters (name, force) minimally. Provides meaning beyond schema for force parameter but not for name. Adequate for simple tool.

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?

Description clearly states 'Stop a running VM' with a specific verb and resource. It distinguishes from sibling tools like start_vm, suspend_vm, and delete_vm.

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?

No explicit guidance on when to use this tool vs alternatives. Usage is implied but not clarified, e.g., when a graceful shutdown is needed or when to force stop.

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