Skip to main content
Glama
heresun

OrbStack MCP Server

by heresun

orbstack_docker_rm

Destructive

Remove Docker containers from your macOS system. Stop containers first before deletion. Use this tool to manage container lifecycle and free up system resources.

Instructions

删除 Docker 容器。

容器必须已停止才能删除。如需强制删除运行中的容器请先停止。

Args: params: 包含容器 ID 或名称

Returns: str: 删除结果

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function that executes 'docker rm' for the 'orbstack_docker_rm' MCP tool.
    async def orbstack_docker_rm(params: DockerContainerInput) -> str:
        """删除 Docker 容器。
    
        容器必须已停止才能删除。如需强制删除运行中的容器请先停止。
    
        Args:
            params: 包含容器 ID 或名称
    
        Returns:
            str: 删除结果
        """
        code, stdout, stderr = await _run_docker(["rm", params.container])
        if code != 0:
            if "running" in stderr.lower() or "is running" in stderr.lower():
                return _format_error(stderr, "容器仍在运行,请先使用 orbstack_docker_stop 停止容器")
            return _format_error(stderr)
        return f"容器 '{params.container}' 已删除"
  • Registration of the 'orbstack_docker_rm' tool using the @mcp.tool decorator.
    @mcp.tool(
        name="orbstack_docker_rm",
        annotations={
            "title": "删除 Docker 容器",
            "readOnlyHint": False,
            "destructiveHint": True,
            "idempotentHint": False,
            "openWorldHint": False,
        },
    )
Behavior4/5

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

The description adds valuable behavioral context beyond annotations. While annotations already indicate destructiveHint=true (mutation) and readOnlyHint=false, the description clarifies the prerequisite condition (container must be stopped) and the force deletion workflow. This provides important operational guidance not captured in annotations.

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 appropriately sized with clear sections (purpose, prerequisites, Args, Returns). Each sentence earns its place by providing essential information. The structure is front-loaded with the core purpose first, followed by important constraints.

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 destructive operation with 1 parameter and an output schema exists, the description provides good context about prerequisites and behavior. The output schema handles return value documentation, so the description appropriately focuses on operational guidance. It covers the essential aspects for a deletion tool.

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?

With 0% schema description coverage, the schema provides no parameter documentation. The description adds some value by mentioning '容器 ID 或名称' (container ID or name) in the Args section, but doesn't provide format examples, constraints, or clarify what 'params' contains beyond referencing the container identifier. It partially compensates for the schema gap but not fully.

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 the specific action ('删除' meaning delete) and resource ('Docker 容器' meaning Docker container). It distinguishes from siblings like 'orbstack_docker_stop' (which stops containers) and 'orbstack_docker_ps' (which lists containers) by focusing on deletion.

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 provides explicit context about when to use it ('容器必须已停止才能删除' - container must be stopped before deletion) and mentions an alternative approach ('如需强制删除运行中的容器请先停止' - if you need to force delete a running container, stop it first). However, it doesn't explicitly name specific sibling tools as alternatives for different scenarios.

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