Skip to main content
Glama
heresun

OrbStack MCP Server

by heresun

orbstack_docker_rm

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

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,
        },
    )

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