Skip to main content
Glama

docker_list_images

List local Docker images with repository, tag, and size information to manage container infrastructure.

Instructions

List local Docker images with repository, tag, and size

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
allNoShow all images including intermediate

Implementation Reference

  • The actual implementation of the tool 'docker_list_images'.
    export async function listImages(args: Record<string, unknown>): Promise<string> {
      const docker = getDockerClient();
      const images = await docker.listImages({ all: (args.all as boolean) || false });
    
      if (images.length === 0) {
        return "No images found.";
      }
    
      const headers = ["REPOSITORY:TAG", "IMAGE ID", "SIZE", "CREATED"];
      const rows = images.map((img) => {
        const tags = (img.RepoTags || ["<none>"]).join(", ");
        const created = new Date(img.Created * 1000);
        const age = Math.floor((Date.now() - created.getTime()) / 86400000);
    
        return [
          tags,
          img.Id.replace("sha256:", "").substring(0, 12),
          formatBytes(img.Size),
          `${age}d ago`,
        ];
      });
    
      return `Docker images:\n\n${formatTable(headers, rows)}`;
    }
  • Registration of the 'docker_list_images' tool with its input schema.
    {
      name: "docker_list_images",
      description: "List local Docker images with repository, tag, and size",
      inputSchema: {
        type: "object" as const,
        properties: {
          all: { type: "boolean", description: "Show all images including intermediate" },
        },
      },
    },

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