Skip to main content
Glama
heresun

OrbStack MCP Server

by heresun

orbstack_docker_exec

Execute commands within running Docker containers to manage processes, inspect configurations, or perform maintenance tasks.

Instructions

在运行中的 Docker 容器中执行命令。

Args: params: 包含容器标识和要执行的命令

Returns: str: 命令输出

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The implementation of the orbstack_docker_exec tool, which executes commands in a Docker container.
    async def orbstack_docker_exec(params: DockerExecInput) -> str:
        """在运行中的 Docker 容器中执行命令。
    
        Args:
            params: 包含容器标识和要执行的命令
    
        Returns:
            str: 命令输出
        """
        args = ["exec", params.container] + params.command.split()
        code, stdout, stderr = await _run_docker(args)
        if code != 0:
            return _format_error(stderr or stdout)
        return stdout if stdout else "(命令执行完毕,无输出)"
  • The MCP tool registration for orbstack_docker_exec.
        name="orbstack_docker_exec",
        annotations={
            "title": "在容器中执行命令",
            "readOnlyHint": False,
            "destructiveHint": False,
            "idempotentHint": False,
            "openWorldHint": False,
        },
    )
  • The input schema definition (Pydantic model) for the orbstack_docker_exec tool.
    class DockerExecInput(BaseModel):
        """在容器中执行命令的输入参数"""
        model_config = ConfigDict(str_strip_whitespace=True, extra="forbid")
    
        container: str = Field(
            ...,
            description="容器 ID 或名称",
            min_length=1,
        )
Behavior2/5

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

Annotations indicate readOnlyHint=false, openWorldHint=false, idempotentHint=false, destructiveHint=false, but the description adds minimal behavioral context. It mentions '在运行中的 Docker 容器中' (in a running Docker container), which implies a prerequisite, but doesn't disclose execution details like timeout, permissions, interactive vs. non-interactive mode, error handling, or side effects. With annotations covering basic safety, the description adds some value but lacks depth for a command-execution tool.

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 concise and well-structured: a clear purpose sentence, followed by 'Args:' and 'Returns:' sections. Each section is brief and to the point, with no redundant information. However, the 'Args:' section could be more integrated into the flow rather than a separate label.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (executing commands in containers), annotations provide basic hints, and an output schema exists (implied by 'Returns: str: 命令输出'), so the description doesn't need to detail return values. However, it lacks context on execution behavior (e.g., security implications, output streaming), prerequisites, and differentiation from siblings. For a command-execution tool, this leaves gaps in guiding the agent effectively.

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?

Schema description coverage is 0%, but the description adds a brief note: '包含容器标识和要执行的命令' (contains container identifier and command to execute). This clarifies that 'params' includes 'container' and 'command', matching the schema's properties. However, it doesn't explain parameter formats (e.g., container ID vs. name), command syntax, or examples beyond what's in the schema's property descriptions. The description compensates partially but not fully for the low coverage.

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: '在运行中的 Docker 容器中执行命令' (execute commands in a running Docker container). It specifies the verb '执行命令' (execute commands) and the resource '运行中的 Docker 容器' (running Docker container). However, it doesn't explicitly differentiate from sibling tools like 'orbstack_docker_run' (which creates and runs containers) or 'orbstack_machine_run' (which runs commands in machines).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., the container must be running), compare it to sibling tools like 'orbstack_docker_run' (for creating containers) or 'orbstack_machine_run' (for machines), or specify use cases (e.g., debugging, administration). The agent must infer usage from the purpose alone.

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