Skip to main content
Glama

docker_inspect_container

Retrieve detailed configuration and status information for a specific Docker container to monitor and manage containerized applications.

Instructions

Get detailed information about a Docker container

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesContainer ID or name

Implementation Reference

  • The inspectContainer function fetches detailed information about a Docker container using the Docker SDK.
    export async function inspectContainer(args: Record<string, unknown>): Promise<string> {
      const docker = getDockerClient();
      const id = args.id as string || args.name as string;
      if (!id) throw new Error("Container ID or name is required");
    
      const container = docker.getContainer(id);
      const info = await container.inspect();
    
      const lines = [
        `Name:       ${info.Name}`,
        `ID:         ${info.Id.substring(0, 12)}`,
        `Image:      ${info.Config.Image}`,
        `Status:     ${info.State.Status}`,
        `Running:    ${info.State.Running}`,
        `PID:        ${info.State.Pid}`,
        `Started:    ${info.State.StartedAt}`,
        `IP:         ${info.NetworkSettings.IPAddress || "N/A"}`,
        "",
        `Command:    ${(info.Config.Cmd || []).join(" ")}`,
      ];
    
      if (info.HostConfig.Memory) {
        lines.push(`Memory:     ${Math.round(info.HostConfig.Memory / 1024 / 1024)}Mi`);
      }
    
      const ports = info.NetworkSettings.Ports || {};
      if (Object.keys(ports).length > 0) {
        lines.push("", "Ports:");
        for (const [containerPort, bindings] of Object.entries(ports)) {
          const bindStr = (bindings || []).map((b: { HostIp: string; HostPort: string }) => `${b.HostIp}:${b.HostPort}`).join(", ");
          lines.push(`  ${containerPort} → ${bindStr || "none"}`);
        }
      }
    
      return lines.join("\n");
    }
  • The definition of the docker_inspect_container tool, including its name, description, and input schema.
    {
      name: "docker_inspect_container",
      description: "Get detailed information about a Docker container",
      inputSchema: {
        type: "object" as const,
        properties: {
          id: { type: "string", description: "Container ID or name" },
        },
        required: ["id"],
      },
    },
  • The switch case in handleDockerTool that delegates the tool call to the inspectContainer implementation.
    case "docker_inspect_container": return inspectContainer(a);
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool 'gets' information, implying a read-only operation, but does not specify if it requires specific permissions, returns structured JSON, handles errors (e.g., invalid container ID), or has rate limits. For a tool with no annotations, this is a significant gap in transparency.

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, clear sentence with zero waste—it directly states the tool's purpose without fluff. It is appropriately sized and front-loaded, making it easy for an agent to parse quickly.

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

Completeness2/5

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

Given the complexity of inspecting a Docker container (which can return extensive configuration and state data), the description is incomplete. There are no annotations, no output schema, and the description lacks details on return format, error handling, or behavioral traits. This makes it inadequate for an agent to fully understand how to use the tool 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?

The input schema has 100% description coverage, with the parameter 'id' documented as 'Container ID or name'. The description does not add any meaning beyond this, such as examples or constraints (e.g., partial IDs are accepted). Since the schema does the heavy lifting, the baseline score of 3 is appropriate, but no extra value is provided.

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 verb ('Get') and resource ('detailed information about a Docker container'), making the purpose specific and understandable. It distinguishes from siblings like docker_list_containers (which lists containers) and docker_inspect_image (which inspects images). However, it could be more precise about what 'detailed information' entails, such as configuration, state, or network details.

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 does not mention prerequisites (e.g., needing a running container), exclusions (e.g., not for stopped containers), or comparisons to siblings like docker_container_stats (for real-time metrics) or docker_inspect_network (for network details). This lack of context makes it harder for an agent to choose appropriately.

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