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
| Name | Required | Description | Default |
|---|---|---|---|
| params | Yes |
Implementation Reference
- src/orbstack_mcp/server.py:763-779 (handler)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}' 已删除" - src/orbstack_mcp/server.py:753-762 (registration)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, }, )