Skip to main content
Glama

docker_inspect_image

Retrieve detailed configuration and metadata from Docker images to analyze their structure, dependencies, and runtime requirements.

Instructions

Get detailed information about a Docker image

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesImage name or ID

Implementation Reference

  • Handler function that executes the "docker_inspect_image" tool logic using the Docker client.
    export async function inspectImage(args: Record<string, unknown>): Promise<string> {
      const docker = getDockerClient();
      const name = args.name as string || args.id as string;
      if (!name) throw new Error("Image name or ID is required");
    
      const image = docker.getImage(name);
      const info = await image.inspect();
    
      const lines = [
        `Image: ${(info.RepoTags || []).join(", ")}`,
        `ID:    ${info.Id.replace("sha256:", "").substring(0, 12)}`,
        `Size:  ${formatBytes(info.Size)}`,
        `Arch:  ${info.Architecture}`,
        `OS:    ${info.Os}`,
        "",
        `Cmd:   ${(info.Config.Cmd || []).join(" ")}`,
        `Env:   ${(info.Config.Env || []).length} variables`,
      ];
    
      const layers = info.RootFS?.Layers || [];
      lines.push(`Layers: ${layers.length}`);
    
      return lines.join("\n");
    }
  • Schema definition for the "docker_inspect_image" tool.
    {
      name: "docker_inspect_image",
      description: "Get detailed information about a Docker image",
      inputSchema: {
        type: "object" as const,
        properties: {
          name: { type: "string", description: "Image name or ID" },
        },
        required: ["name"],
      },
  • Registration of the "docker_inspect_image" tool in the switch handler.
    case "docker_inspect_image": return inspectImage(a);

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