Skip to main content
Glama
heresun

OrbStack MCP Server

by heresun

orbstack_docker_logs

Read-onlyIdempotent

Retrieve Docker container logs to monitor application output and debug issues. Specify container ID/name and number of lines to view recent activity.

Instructions

获取 Docker 容器的日志输出。

Args: params: 包含容器标识和日志行数

Returns: str: 容器日志

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The async function `orbstack_docker_logs` that executes the docker logs command.
    async def orbstack_docker_logs(params: DockerLogsInput) -> str:
        """获取 Docker 容器的日志输出。
    
        Args:
            params: 包含容器标识和日志行数
    
        Returns:
            str: 容器日志
        """
        args = ["logs", "--tail", str(params.tail), params.container]
        code, stdout, stderr = await _run_docker(args)
        if code != 0:
            return _format_error(stderr)
        output = stdout or stderr  # 有些程序输出到 stderr
  • The tool registration using the `@mcp.tool` decorator.
    @mcp.tool(
        name="orbstack_docker_logs",
        annotations={
            "title": "查看容器日志",
            "readOnlyHint": True,
            "destructiveHint": False,
            "idempotentHint": True,
            "openWorldHint": False,
        },
    )
  • The Pydantic schema `DockerLogsInput` defining the input parameters for the tool.
    class DockerLogsInput(BaseModel):
        """获取容器日志的输入参数"""
        model_config = ConfigDict(str_strip_whitespace=True, extra="forbid")
    
        container: str = Field(
            ...,
            description="容器 ID 或名称",
            min_length=1,
        )
        tail: Optional[int] = Field(
Behavior3/5

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

The description adds minimal behavioral context beyond what annotations provide. Annotations already declare readOnlyHint=true, destructiveHint=false, idempotentHint=true, and openWorldHint=false, covering safety and idempotency. The description only states it '获取 Docker 容器的日志输出' (gets Docker container log output), which aligns with annotations but doesn't add meaningful behavioral details like rate limits, authentication needs, or what happens with non-existent containers. No contradiction with annotations exists.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is brief with three sentences, but the structure is somewhat awkward with separate 'Args' and 'Returns' sections that might be better integrated. It's front-loaded with the main purpose, but the additional sections feel redundant since similar information could be inferred from the schema. Every sentence serves a purpose, but the formatting could be more streamlined.

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 moderate complexity (Docker logs operation), rich annotations (covering safety and idempotency), and the presence of an output schema (which handles return values), the description is minimally adequate. However, it lacks context about error conditions, performance characteristics, or how it interacts with other Docker tools. For a tool with 0% schema description coverage, it should provide more parameter guidance to be fully complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description mentions 'params: 包含容器标识和日志行数' (params: includes container identifier and log line count), which adds some meaning beyond the schema. However, with 0% schema description coverage, the schema provides no descriptions for the parameters themselves. The description partially compensates by naming two parameters (container and tail) but misses the 'follow' parameter entirely and doesn't explain their semantics in detail, leaving significant gaps.

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 容器的日志输出' (get Docker container log output), which is a specific verb+resource combination. It distinguishes itself from siblings like orbstack_docker_inspect or orbstack_docker_ps by focusing specifically on logs. However, it doesn't explicitly differentiate from potential similar logging tools (though none exist in the sibling list), so it doesn't reach the highest score.

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. While it's clear this is for getting logs, there's no mention of when to choose it over other Docker inspection tools or any prerequisites. The only contextual note is in the schema description for 'follow' parameter, but this isn't part of the main description text.

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