Skip to main content
Glama

container_export

Export a container's filesystem to a tar archive, either to a host file or in-band bytes. Supports large containers with direct-to-disk streaming and overwrite control.

Instructions

Export a container's filesystem as a tar archive: to a file on the server host, or in band.

The tar is a flat filesystem snapshot with no image metadata or layers — use image_save for an archive that image_load can restore, and container_archive_get for a single file or directory. With dest_path the archive streams straight to disk (no byte cap), so it handles large containers — 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: id_or_name - The container id or name dest_path - Destination path on the server host; omit to return the bytes in band overwrite - Replace dest_path if it already exists (default False) max_bytes - In-band mode: abort with ValueError beyond this many bytes (default 32 MiB) returns: bytes | dict - the tar bytes (in band), or {"path": , "bytes_written": int}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dest_pathNo
max_bytesNo
overwriteNo
id_or_nameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

Beyond the annotations (readOnlyHint=false, destructiveHint=false), the description discloses many behavioral details: the tar is a flat filesystem snapshot with no image metadata, the file write behavior (server user, ~ expansion, refusal of existing files without overwrite), the byte cap in in-band mode with ValueError aborts, and the return format. This significantly aids the agent in anticipating side effects and limitations.

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 dense but organized: a high-level summary, explicit sibling alternatives, mode-specific behavior, and a parameter list. Every sentence adds value, and the structure makes it easy to parse. It is not bloated despite its length.

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 (two output modes, overwrite logic, byte caps), the description fully covers selection criteria, behavior, parameter semantics, and return values. The absence of an external output schema is compensated by an explicit 'returns' description. No important context is missing.

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

Parameters5/5

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

The input schema has 0% description coverage, so the description must compensate. It does so thoroughly with an 'args' section explaining each parameter's meaning, default, and behavior (e.g., dest_path omission for in-band mode, overwrite default False, max_bytes cap and abort). This adds essential semantic value beyond the bare schema.

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 clearly states that the tool exports a container's filesystem as a tar archive, with two modes: to a file on the server host or in band. It explicitly distinguishes from sibling tools by naming image_save and container_archive_get and explaining their different purposes, making the tool's specific role unambiguous.

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 provides explicit when-to-use guidance: it recommends image_save for restorable archives, container_archive_get for single files/directories, and explains when to use dest_path vs. in-band mode. It also mentions the fallback justification for in-band mode (containerized server without a writable host path).

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/L337-org/docker-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server