Skip to main content
Glama
heresun

OrbStack MCP Server

by heresun

orbstack_docker_ps

Read-onlyIdempotent

List Docker containers running on macOS via OrbStack. Shows active containers by default, with an option to display all containers including stopped ones.

Instructions

列出 Docker 容器。

默认只显示运行中的容器,设置 all=True 显示全部。

Args: params: 包含是否显示所有容器的选项

Returns: str: 容器列表(格式化表格)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function for the 'orbstack_docker_ps' tool, which executes 'docker ps' via '_run_docker'.
    async def orbstack_docker_ps(params: DockerPsInput) -> str:
        """列出 Docker 容器。
    
        默认只显示运行中的容器,设置 all=True 显示全部。
    
        Args:
            params: 包含是否显示所有容器的选项
    
        Returns:
            str: 容器列表(格式化表格)
        """
        args = ["ps", "--format", "table {{.ID}}\t{{.Names}}\t{{.Image}}\t{{.Status}}\t{{.Ports}}"]
        if params.all:
            args.append("-a")
    
        code, stdout, stderr = await _run_docker(args)
        if code != 0:
            return _format_error(stderr, "请确认 OrbStack 正在运行: orbstack_start")
        if not stdout or stdout.count("\n") == 0:
            return "当前没有运行中的容器。" + (" 使用 --all 查看所有容器。" if not params.all else "")
        return f"Docker 容器:\n{stdout}"
  • The tool registration for 'orbstack_docker_ps' using the '@mcp.tool' decorator.
    @mcp.tool(
        name="orbstack_docker_ps",
        annotations={
            "title": "列出 Docker 容器",
            "readOnlyHint": True,
            "destructiveHint": False,
            "idempotentHint": True,
            "openWorldHint": False,
        },
  • The Pydantic model 'DockerPsInput' defining the input schema for the tool.
    class DockerPsInput(BaseModel):
        """列出 Docker 容器的输入参数"""
        model_config = ConfigDict(extra="forbid")
    
        all: bool = Field(
Behavior3/5

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

Annotations already provide readOnlyHint=true, destructiveHint=false, idempotentHint=true, and openWorldHint=false, covering safety and idempotency. The description adds useful context about the default filtering behavior (running containers only) and output format (formatted table), which goes beyond what annotations provide. However, it doesn't mention rate limits, authentication needs, or pagination behavior.

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 three clear sections: purpose statement, parameter explanation, and return value description. Each sentence earns its place. However, the Args/Returns formatting could be more integrated with the natural language description rather than separate labeled sections.

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 simple read-only listing tool with good annotations and an output schema (which handles return value documentation), the description provides sufficient context. It covers the tool's purpose, parameter behavior, and output format. For a tool with only one parameter and clear safety annotations, this is reasonably complete.

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?

With 0% schema description coverage (the schema has no parameter descriptions), the description carries the full burden. It clearly explains the 'all' parameter's purpose and default value, which covers the single parameter's semantics effectively. The description compensates well for the schema's lack of documentation.

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 as '列出 Docker 容器' (list Docker containers), which is a specific verb+resource combination. It distinguishes from siblings like 'orbstack_docker_images' (lists images) and 'orbstack_docker_inspect' (shows detailed container info). However, it doesn't explicitly differentiate from 'orbstack_compose_ps' which also lists containers but specifically for Docker Compose.

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 implied usage guidance by mentioning the default behavior (shows only running containers) and how to change it (set all=True). However, it doesn't explicitly state when to use this tool versus alternatives like 'orbstack_docker_inspect' for detailed container information or 'orbstack_compose_ps' for Compose-managed containers.

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