Skip to main content
Glama

container_export

Export a container's filesystem as a tar archive, either to a host file or as in-band bytes for retrieval. Handles large containers when writing to disk.

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: dest_path: Destination path on the server host; omit to return the bytes in band 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 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

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.0.0

TDQS

A4.9/5.0
Behavior5/5

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

The annotations only provide readOnlyHint=false and destructiveHint=false, so the description carries the behavioral burden. It provides rich detail: the tar is flat with no metadata/layers, dest_path streams to disk with no byte cap, the file is written by the server's user, ~ is expanded, existing files are refused unless overwrite=True, in-band responses are capped at max_bytes because of MCP base64 encoding, and exceeding the cap aborts with ToolInputError. This greatly exceeds what annotations offer.

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 long but well structured: a one-line summary, then sibling differentiation, then mode-specific behavior, then an Args list, then Returns. Every sentence adds operational detail. The front-loaded summary ensures the core purpose is immediately clear despite the 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?

For a tool with one required parameter aliasable by id/nameable container, the description covers the two modes, the exact arguments, defaults, error behavior, return shape, and limitations. It also explains why the byte cap exists, which is not structurally available elsewhere. The only small gap is the undocumented id_or_name parameter, but this is minor given the rest of the description's completeness.

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 compensate. It documents dest_path, overwrite, and max_bytes with behavior and defaults, which is substantial. However, id_or_name, the single required parameter, does not appear in the Args list. While the parameter name is self-explanatory, the description missed an opportunity to explicitly state it identifies the container by ID or name.

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 begins with a precise verb-resource statement: 'Export a container's filesystem as a tar archive' and immediately distinguishes two output modes. It explicitly contrasts this tool with image_save and container_archive_get, so an agent can tell it apart from these siblings without opening schemas.

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 gives clear when-to-use and when-not-to-use guidance: use image_save when the archive needs to be restored via image_load, use container_archive_get for a single file or directory, and use container_export for a flat filesystem snapshot. It also explains when to use dest_path vs. in-band mode, including the fallback scenario for containerized servers without writable host paths.

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