Inspect archive (facts, determinism verdict, CI checks)
inspect_zipInspect a ZIP archive in a single call to retrieve comprehensive metadata, integrity diagnostics, and determinism checks without extracting files.
Instructions
Read-only archive report in ONE call: size, entry / file / directory counts, Zip64, comment, compressed vs uncompressed totals, per-method counts, encrypted / symlink / data-descriptor / Zip64 / cp437 / duplicate / unsafe-name counts, date range, a determinism verdict (epoch timestamps + canonical order + UTF-8 flags ⇒ reproducible; canonicalLayout = no data descriptors) and every engine diagnostic (prepended SFX data, name mismatches, …). Opens EAGERLY by default: every entry's real extent is checked up front — overlapping entries, entries reaching into the central directory or past EOF, and Zip64 spoofing — and refused with their ZIP_* code rather than summarised (a method / CRC / size divergence between central and local headers is caught by verify_zip and on read, not here). check:[…] / assert:{…} turn it into a CI gate → checks[] + checksPassed. Token-frugal: verbosity:'summary', fields:[…]. Input: zipBase64 or zipPath (sandbox).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| check | No | CI assertions evaluated over the report: deterministic, epoch-timestamps, canonical-order, utf8-names, no-data-descriptor, canonical-layout, no-zip64, zip64, no-encryption, no-symlinks, safe-names, no-duplicates, no-diagnostics, store-only, deflate-only. Result: `checks[]` + `checksPassed`. | |
| assert | No | Parametrised assertions (each becomes a `checks[]` row). | |
| fields | No | Dot-path projection applied after verbosity (e.g. ['entryCount', 'entries.name']); array segments map over elements; unmatched paths are reported in _meta.unmatchedFields. | |
| limits | No | Override zipnative's named security bounds for this call (CWE-400 / CWE-409 guards). Every key is optional; absent keys keep the engine defaults (maxEntries 100000, maxEntryUncompressedSize 1 GiB, maxTotalUncompressedSize 8 GiB, maxCompressionRatio 1024, maxNameBytes 4096, maxExtraFieldBytes 65535, maxCommentBytes 65535, maxCentralDirectoryBytes 256 MiB). Values above the operator ceilings (ZIPNATIVE_MCP_MAX_UNCOMPRESSED_BYTES, ZIPNATIVE_MCP_MAX_ENTRIES) are refused with LIMIT_CEILING_EXCEEDED. Raise a bound for trusted input only. | |
| strict | No | Escalate the first engine diagnostic (prepended data, duplicate name, name mismatch, …) to a ZIP_STRICT_DIAGNOSTIC error instead of reporting it. | |
| zipPath | No | Relative path of an archive inside the ZIPNATIVE_MCP_OUTPUT_DIR sandbox (no absolute paths, no '..'; container extensions only: .zip .jar .docx .epub …). Exclusive with zipBase64. Lets a create/modify → verify/extract chain avoid re-sending the bytes. | |
| validate | No | 'eager' (default) cross-checks every local header and the overlap table up front — hostile shapes are refused here; 'lazy' defers to first read (cheaper on huge archives). | eager |
| verbosity | No | 'summary' returns only the scalar verdict fields (drops arrays and payloads) — the token-frugal form. | full |
| zipBase64 | No | The archive bytes as base64 (exactly once; a data: URI prefix is tolerated). Exclusive with zipPath. Decoded size ≤ 128 MiB. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ratio | No | ||
| checks | No | ||
| comment | No | Archive comment (UTF-8, lossy). | |
| isZip64 | No | A Zip64 end-of-central-directory record is present. | |
| methods | No | ||
| fileCount | No | ||
| commentHex | No | ||
| entryCount | No | ||
| latestDate | No | ||
| determinism | No | `deterministic` = reproducible (epoch timestamps + canonical order + UTF-8 flags); `canonicalLayout` = the buffered layout (no data descriptors) — a streamed archive is reproducible but not canonical. | |
| diagnostics | No | Non-fatal conformance concerns the engine raised while parsing or writing (de-duplicated by code + entry, at most 200). Empty for a clean archive. Codes: ZIP_PREPENDED_DATA, ZIP_MULTIPLE_EOCD, ZIP_NAME_MISMATCH, ZIP_UNICODE_PATH_CONFLICT, ZIP_INVALID_UTF8_NAME, ZIP_DUPLICATE_NAME, ZIP_EXTRA_FIELD_MALFORMED, ZIP_ZIP64_EXTRA_IGNORED, ZIP_TIMESTAMP_NOT_PINNED, ZIP_NONDETERMINISTIC_CODEC, ZIP_DEAD_BYTES_RATIO. | |
| archiveBytes | No | ||
| checksPassed | No | Present when check / assert was supplied: true when every assertion holds. | |
| commentBytes | No | ||
| earliestDate | No | ||
| multipleEocd | No | ||
| symlinkCount | No | ||
| deterministic | No | summary only: the determinism verdict. | |
| prependedData | No | SFX-style prefix before the first local header (offsets shifted). | |
| utf8NameCount | No | ||
| cp437NameCount | No | ||
| directoryCount | No | ||
| encryptedCount | No | ||
| canonicalLayout | No | summary only: buffered (no data descriptor) layout. | |
| compressedBytes | No | ||
| diagnosticCount | No | summary only: number of distinct diagnostics. | |
| unsafeNameCount | No | Names sanitizeEntryPath() refuses (traversal, absolute, drive/UNC, NUL, ADS, device names). | |
| zip64EntryCount | No | ||
| diagnosticCounts | No | Number of diagnostics received per code (counts every occurrence, including de-duplicated ones). | |
| uncompressedBytes | No | ||
| duplicateNameCount | No | ||
| dataDescriptorCount | No | ||
| diagnosticsTruncated | No | Present (true) when more than 200 distinct diagnostics were dropped from `diagnostics`. |