Skip to main content
Glama

image_save

Save a Docker image as a tar archive to a server-host file or return it in-band as base64 bytes, preserving layers, tags, and metadata for later restore.

Instructions

Save an image as a tar archive: to a file on the server host, or in band.

The archive keeps layers, tags, and metadata so image_load can restore it - different from container_export, which flattens one container's filesystem. With dest_path the archive streams straight to disk (no byte cap), so it handles large images - the file is written by the server's user, ~ is expanded, and an existing file is refused unless overwrite=True. Without dest_path the tar bytes are returned in band, capped at max_bytes (default 32 MiB) because MCP base64-encodes them - a fallback for when no writable host path exists (e.g. a containerized server without a bind mount).

Args: dest_path: Destination path on the server host; omit to return the bytes in band named: Whether to retain repository/tag names in the saved archive overwrite: Replace dest_path if it already exists max_bytes: In-band mode: abort with ToolInputError beyond this many bytes (default 32 MiB)

Returns: bytes | dict: the tarball bytes (in band), or {"path": , "bytes_written": int}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
namedNo
dest_pathNo
max_bytesNo
overwriteNo
id_or_nameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.0.0

TDQS

A4.8/5.0
Behavior5/5

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

The description discloses operational behavior well beyond the annotations: `~` expansion, server-user file ownership, refusal of existing files unless `overwrite=True`, absence of a byte cap for `dest_path`, and the `ToolInputError` abort in in-band mode. It also documents the return shape. This fully covers the behavioral surface.

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

Conciseness4/5

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

The description is moderately long but well-structured, with the primary action up front followed by mode-specific behavior and a clean Args block. Minor redundancy exists (e.g., the 32 MiB default is mentioned twice), but every paragraph earns its place.

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

Completeness5/5

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

Given the tool's complexity, the description covers invocation modes, limits, error behavior, output format, and relevant alternatives. The output schema is already present, and the description complements it with the practical context an agent needs to call the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must carry parameter meaning, and it does for `dest_path`, `named`, `overwrite`, and `max_bytes`, including defaults and mode-specific effects. The only gap is `id_or_name`, which is implied by 'an image' but not explicitly documented as the target image identifier.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific action ('Save an image as a tar archive'), identifies the resource ('an image'), and clearly distinguishes the tool from `container_export` by preserving layers, tags, and metadata. It also covers the two operational modes (file vs in-band), making the purpose unmistakable.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly explains when to use the in-band mode vs `dest_path`, how to handle large images, and why the `max_bytes` fallback exists. It also names the relevant sibling `container_export` and contrasts it directly, so an agent can choose between related tools without guessing.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools