Skip to main content
Glama
heresun

OrbStack MCP Server

by heresun

orbstack_machine_create

Create a new Linux virtual machine with supported distributions like Ubuntu, Debian, Fedora, Arch, or Alpine. Specify architecture for cross-platform compatibility on Apple Silicon systems.

Instructions

创建一个新的 Linux 虚拟机。

支持 ubuntu, debian, fedora, arch, alpine 等多种发行版。 在 Apple Silicon 上可通过 arch 参数指定 amd64 来运行 Intel 架构。

Args: params: 创建参数,包括发行版名称、可选的机器名和架构

Returns: str: 创建结果

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function for the `orbstack_machine_create` tool, which executes the `orb` CLI command to create a new Linux machine.
    async def orbstack_machine_create(params: MachineCreateInput) -> str:
        """创建一个新的 Linux 虚拟机。
    
        支持 ubuntu, debian, fedora, arch, alpine 等多种发行版。
        在 Apple Silicon 上可通过 arch 参数指定 amd64 来运行 Intel 架构。
    
        Args:
            params: 创建参数,包括发行版名称、可选的机器名和架构
    
        Returns:
            str: 创建结果
        """
        args = ["create"]
        if params.arch:
            args.extend(["--arch", params.arch])
        args.append(params.distro)
        if params.name:
            args.append(params.name)
    
        code, stdout, stderr = await _run_orb(args, timeout=120)
        if code != 0:
            return _format_error(
                stderr,
                "可用发行版: ubuntu, debian, fedora, arch, alpine, centos, rocky, opensuse 等",
            )
        name = params.name or params.distro
        return f"Linux 机器 '{name}' 创建成功!\n{stdout}" if stdout else f"Linux 机器 '{name}' 创建成功!"
  • The MCP tool registration for `orbstack_machine_create` using the `@mcp.tool` decorator.
    @mcp.tool(
        name="orbstack_machine_create",
        annotations={
            "title": "创建 Linux 机器",
            "readOnlyHint": False,
            "destructiveHint": False,
            "idempotentHint": False,
            "openWorldHint": False,
        },
    )
  • The Pydantic model `MachineCreateInput` defining the schema for the tool arguments.
    class MachineCreateInput(BaseModel):
        """创建 Linux 机器的输入参数"""
        model_config = ConfigDict(str_strip_whitespace=True, extra="forbid")
    
        distro: str = Field(
            ...,
            description="Linux 发行版名称,如 ubuntu, debian, fedora, arch, alpine 等",
            min_length=1,
            max_length=50,
        )
        name: Optional[str] = Field(
            default=None,
            description="机器名称,不指定则自动生成",
            max_length=100,
        )
        arch: Optional[str] = Field(
            default=None,
            description="CPU 架构:amd64 或 arm64,默认为宿主机架构",
Behavior3/5

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

Annotations indicate readOnlyHint=false (mutation), destructiveHint=false (non-destructive), idempotentHint=false (non-idempotent), and openWorldHint=false (closed-world). The description adds useful behavioral context beyond annotations: it specifies supported distributions, mentions Apple Silicon compatibility with amd64 architecture, and indicates that name is optional (auto-generated if not specified). However, it doesn't describe important behavioral aspects like whether this creates persistent VMs, what resources are allocated, or potential rate limits.

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?

The description is well-structured with a clear purpose statement, feature highlights, and separate Args/Returns sections. It's appropriately sized at 4 sentences (Chinese). However, the 'Returns: str: 创建结果' section is redundant since there's an output schema, and the structure could be more front-loaded with the most critical information.

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 this is a mutation tool (readOnlyHint=false) with 1 parameter (nested object with 3 sub-parameters), 0% schema description coverage, but with an output schema present, the description provides adequate context. It covers the core purpose, supported distributions, architecture considerations, and parameter overview. The output schema means return values don't need explanation in the description. However, for a VM creation tool, more details about resource allocation or creation constraints would be helpful.

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?

Schema description coverage is 0%, so the description carries full burden for parameter documentation. The description provides good semantic information: it lists supported distributions, explains the arch parameter's purpose for Apple Silicon, and mentions that params includes '发行版名称、可选的机器名和架构' (distribution name, optional machine name, and architecture). However, it doesn't fully document all parameter details like format constraints or default behaviors beyond what's implied.

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 tool's purpose: '创建一个新的 Linux 虚拟机' (creates a new Linux virtual machine). It specifies the verb ('创建' - create) and resource ('Linux 虚拟机' - Linux virtual machine), and distinguishes from siblings like orbstack_machine_delete, orbstack_machine_info, and orbstack_machine_list. However, it doesn't explicitly differentiate from other creation tools like orbstack_docker_run or orbstack_compose_up, which also create resources.

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 some implied usage context by listing supported distributions (ubuntu, debian, fedora, arch, alpine) and mentioning the arch parameter for Apple Silicon. However, it doesn't explicitly state when to use this tool versus alternatives like orbstack_docker_run (for containers) or orbstack_compose_up (for Docker Compose). No explicit 'when-not-to-use' guidance or prerequisites are provided.

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/heresun/orbstack-mcp'

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