Inspect archive (facts, determinism verdict, CI checks)
inspect_zipGenerate a read-only ZIP report in one call: counts, sizes, methods, encryption, symlinks, unsafe names, duplicates, determinism verdict, and diagnostics for inspection or CI checks.
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).
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "inspect_zip"
}
}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, and the engine's canonical form (canonical-form = zipnative's analyzeDeterminism verdict: epoch or pinned timestamps, canonical order, UTF-8 flags, Zip64-only extras, version-made-by 0x032D; canonical-extras; canonical-version-made-by). Result: `checks[]` + `checksPassed`. | |
| access | No | 'auto' (default): in memory, and a zipPath above 1073741824 bytes by byte ranges. 'range': always by byte ranges over the sandbox file (never a URL; memory ≈ the central directory). 'memory': always buffered (INPUT_TOO_LARGE above the cap). | auto |
| assert | No | Parametrised assertions (each becomes a `checks[]` row). | |
| fields | No | Dot-paths to keep, after verbosity (e.g. ['entryCount', 'entries.name']); unmatched ones are listed in _meta.unmatchedFields. | |
| limits | No | Per-call override of zipnative's security bounds (CWE-400/409); absent keys keep the engine defaults (describe_engine.defaultLimits). A value above its operator ceiling is LIMIT_CEILING_EXCEEDED. Raise only for trusted input. | |
| strict | No | Turn the first engine diagnostic into a ZIP_STRICT_DIAGNOSTIC error. | |
| zipPath | No | Archive path relative to the ZIPNATIVE_MCP_OUTPUT_DIR sandbox (container extensions: .zip .jar .docx .epub …). Exclusive with zipBase64; saves re-sending bytes between calls. | |
| 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': scalar verdict fields only (the token-frugal form). | full |
| zipBase64 | No | Archive bytes, base64 (≤ 128 MiB decoded). Exclusive with zipPath. | |
| canonicalDate | No | The date the archive was canonicalised with (canonicalize_zip `date`, modify_zip `canonical.date`): the canonical-form verdict then expects that timestamp on every entry instead of the DOS epoch. Read as UTC, like every date this server writes. | |
| determinismReport | No | true adds `determinismReport`: zipnative's analyzeDeterminism() verdict in full — the stricter canonical form canonicalize_zip produces (also Zip64-only extras and the constant version-made-by) and every offending entry with the rule it breaks. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ratio | No | ||
| access | No | Present when the archive was read by byte ranges (access 'range', or a zipPath above the in-memory cap): `determinism` is then absent and the determinism checks fail with that reason. | |
| 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 engine concerns (de-duplicated by code + entry, ≤ 200; codes in describe_engine.diagnosticCodes). Empty for a clean archive. | |
| 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 | Occurrences per code, duplicates included. | |
| determinismReport | No | Present with determinismReport: true — zipnative's analyzeDeterminism() report. `deterministic` here is the engine's canonical form (stricter than determinism.deterministic: also no extra field but Zip64 and version-made-by 0x032D). | |
| uncompressedBytes | No | ||
| duplicateNameCount | No | ||
| dataDescriptorCount | No | ||
| diagnosticsTruncated | No | true when rows beyond 200 were dropped. |