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
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Image name or ID |
Implementation Reference
- src/tools/docker/images.ts:29-52 (handler)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"); } - src/tools/docker/index.ts:63-72 (schema)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"], }, - src/tools/docker/index.ts:126-126 (registration)Registration of the "docker_inspect_image" tool in the switch handler.
case "docker_inspect_image": return inspectImage(a);