Skip to main content
Glama

docker_compose_logs

View and monitor Docker Compose service logs to troubleshoot issues, track container activity, and analyze application performance in development and production environments.

Instructions

Show logs from Docker Compose services

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
directoryNoDirectory containing docker-compose.yml
serviceNoSpecific service name
tailNoNumber of lines (default: 100)

Implementation Reference

  • The actual implementation of the tool logic that executes 'docker compose logs' via child_process.
    export async function composeLogs(args: Record<string, unknown>): Promise<string> {
      const directory = (args.directory as string) || ".";
      const service = args.service as string | undefined;
      const tail = (args.tail as number) || 100;
    
      const composeArgs = ["compose", "logs", "--no-color", `--tail=${tail}`];
      if (service) composeArgs.push(service);
    
      try {
        const { stdout } = await execFileAsync("docker", composeArgs, {
          cwd: directory,
          timeout: 30000,
        });
        return stdout.trim() || "No compose logs found.";
      } catch (error) {
        const msg = error instanceof Error ? error.message : String(error);
        throw new Error(`Failed to get compose logs: ${msg}`);
      }
    }
  • Registration and definition of the 'docker_compose_logs' tool.
    {
      name: "docker_compose_logs",
      description: "Show logs from Docker Compose services",
      inputSchema: {
        type: "object" as const,
        properties: {
          directory: { type: "string", description: "Directory containing docker-compose.yml" },
          service: { type: "string", description: "Specific service name" },
          tail: { type: "number", description: "Number of lines (default: 100)" },
        },
      },
    },
  • The handler switch statement routing the tool request to the implementation function 'composeLogs'.
    case "docker_compose_logs": return composeLogs(a);
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions 'Show logs' but doesn't disclose behavioral traits like whether it streams or returns static logs, requires specific permissions, has rate limits, or affects system state. This leaves gaps for a tool that interacts with system services.

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

Conciseness5/5

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

The description is a single, efficient sentence with zero waste. It's front-loaded and appropriately sized for the tool's complexity, making it easy to parse quickly.

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 no annotations and no output schema, the description is minimal but covers the basic purpose. For a tool with 3 parameters and system interaction, it should ideally include more on behavior or output format to be complete, but it meets a bare minimum for clarity.

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 100%, so the schema fully documents parameters. The description adds no additional meaning beyond implying logs are from services, but doesn't explain parameter interactions or defaults beyond what's in the schema. Baseline 3 is appropriate as the schema handles the heavy lifting.

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 action ('Show logs') and resource ('from Docker Compose services'), making the purpose evident. However, it doesn't explicitly differentiate from sibling tools like 'docker_container_logs' or 'system_logs', which would require more specificity about the Docker Compose context.

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?

No guidance is provided on when to use this tool versus alternatives. With siblings like 'docker_container_logs' and 'system_logs' available, the description lacks context on Docker Compose-specific usage, prerequisites, or exclusions.

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/batu-sonmez/infraclaude'

If you have feedback or need assistance with the MCP directory API, please join our Discord server