Work with archive files (zip and jar). List entries, extract archives into a filesystem root, or build a zip from files/directories — output to a root path or a content-addressed asset. Sources may be a root+path file, any content reference, or inline base64 bytes. All paths stay inside the FileAdapter's configured roots; extraction is zip-slip protected and capped against zip bombs.
| Name: | archive |
| Class: | covia.adapter.ArchiveAdapter |
This adapter provides 3 MCP tool(s) for AI agent integration:
| Tool Name | Description |
|---|---|
| archive_extract | Extract a zip or jar archive into a filesystem directory. The archive source is exactly one of: a 'root'+'path' file, a resolvable 'contentRef', or inline base64 'bytes'. Files are written under 'destRoot' (a writable root) at optional 'destPath', which is created if needed. Extraction is jailed to the destination (zip-slip protected — entries that escape are rejected) and capped against zip bombs. Returns the number of entries extracted, total bytes written, and a (capped) list of extracted file paths. |
| archive_list | List the entries of a zip or jar archive without extracting it. The archive source is exactly one of: a filesystem 'root'+'path' file, a resolvable 'contentRef', or inline base64 'bytes'. Returns each entry's name, uncompressed size, compressed size, directory flag, and modified time. Large archives are capped: 'count' is the true total, 'entries' is capped and 'truncated' indicates when more exist. |
| archive_zip | Build a zip archive from files and/or directories under a filesystem root. 'root' names the source root; 'path' (single) or 'paths' (array) name the files/directories to include — entry names preserve the given relative paths (zip -r style), directories are added recursively. Output goes to a file when 'destRoot'+'destPath' are given (must be a writable root); otherwise a content-addressed asset is produced and its reference returned (optionally named via 'name'). Capped against runaway entry counts. |