Skip to main content
Glama
zipnative-mcp

zipnative-mcp

Canonicalise archive (reproducible, no recompression)

canonicalize_zip
Idempotent

Rewrite ZIP, JAR, Gradle, Maven, Explorer, or 7-Zip archives into deterministic canonical form without recompressing payloads, so builds produce identical bytes.

Instructions

Make ANY archive reproducible: zipnative's canonicalizeZip() rewrites a Gradle, Maven, zip, Explorer or 7-Zip archive into the canonical deterministic form zipnative itself writes — entries sorted by raw name bytes, one timestamp (the DOS epoch, or a pinned date, read as UTC), the UTF-8 flag on every name, no extra field but Zip64, the constant version-made-by, no data descriptor — WITHOUT recompressing a payload (the compressed bytes travel bit for bit; nothing is decoded, so the result is identical on every runtime). Idempotent: canonicalising the result again returns the same bytes (summary.alreadyCanonical). Entry names and payloads travel verbatim (a corrupt or unsafe entry stays so — run verify_zip first when integrity matters). summary.canonicalForm is the engine's own analyzeDeterminism() verdict on the output. keepComments (default false) and keepExternalAttributes (default true) choose what survives. Duplicate-name archives are refused. Verify with inspect_zip { check:['canonical-form'], canonicalDate } and compare summary.sha256 across builds.

Input Schema

NameRequiredDescriptionDefault
dateNoThe one timestamp written on every entry (ISO-8601, 1980-01-01 … 2107-12-31, read as UTC; 2-second DOS granularity). Default: the DOS epoch 1980-01-01T00:00:00 — the deterministic default. Pass the same value to inspect_zip `canonicalDate` to verify the result.
limitsNoPer-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.
strictNoTurn the first engine diagnostic into a ZIP_STRICT_DIAGNOSTIC error.
zipPathNoArchive path relative to the ZIPNATIVE_MCP_OUTPUT_DIR sandbox (container extensions: .zip .jar .docx .epub …). Exclusive with zipBase64; saves re-sending bytes between calls.
zipBase64NoArchive bytes, base64 (≤ 128 MiB decoded). Exclusive with zipPath.
outputModeNo'base64' (default): inline embedded resource (≤ 50 MiB; the bytes appear in both its data: uri and its blob). 'file': written into the sandbox (never overwrites; ≤ ZIPNATIVE_MCP_MAX_FILE_OUTPUT_BYTES, default 4 GiB) and returned as a resource_link — far fewer tokens.base64
outputPathNoRelative path inside the sandbox (only when outputMode='file'); must end in a container extension (.zip recommended).
keepCommentsNoKeep the archive comment and the entry comments (default false: the canonical form carries none).
includeSha256NoAdd `summary.sha256` of the produced bytes (the reproducibility proof to compare across builds).
keepExternalAttributesNoKeep each entry's external attributes — Unix modes, DOS attributes (default true); false writes the canonical defaults (0o100644 files, 0o40755 directories).

Output Schema

NameRequiredDescriptionDefault
modeYes
summaryYescanonicalize_zip summary.
filePathNoSandboxed absolute path (file mode).
sizeBytesYes
diagnosticsYesNon-fatal engine concerns (de-duplicated by code + entry, ≤ 200; codes in describe_engine.diagnosticCodes). Empty for a clean archive.
diagnosticCountsNoOccurrences per code, duplicates included.
diagnosticsTruncatedNotrue when rows beyond 200 were dropped.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.0.1

TDQS

A4.3/5.0
Behavior5/5

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

Annotations already declare idempotentHint and destructiveHint=false, but the description adds genuinely new behavior: payloads travel bit for bit without recompression, the operation is idempotent with summary.alreadyCanonical as the signal, duplicate-name archives are refused, and corrupt/unsafe entries are preserved rather than fixed. That is exactly the kind of consequence-level disclosure annotations cannot carry.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core promise, then the canonical-form details, then safety caveats and verification. It is dense with em-dash clauses and list-like enumerations, but nearly every clause carries information; slightly tighter phrasing would make it scannable.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 10-parameter mutation tool with an output schema, it covers determinism guarantees, idempotency, refusal cases and verification workflow. The one missing piece is the archive-source requirement (zipPath xor zipBase64), which the agent must infer from the schema.

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

Parameters3/5

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

Schema description coverage is 100%, so the baseline is 3. The description restates the keepComments and keepExternalAttributes defaults, which the schema already documents, and adds only the cross-call hint that the same `date` must be passed to inspect_zip's canonicalDate — useful but marginal, and it never mentions that exactly one of zipPath/zipBase64 must be supplied.

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?

States a specific verb and resource — 'canonicalizeZip() rewrites a Gradle, Maven, zip, Explorer or 7-Zip archive into the canonical deterministic form' — and enumerates exactly what the canonical form is (sorted entries, one timestamp, UTF-8 flag, no data descriptor). It is clearly distinguishable from inspect_zip, verify_zip and create_zip by being a rewrite-in-place-of-bytes transform.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives concrete routing: 'run verify_zip first when integrity matters' and 'Verify with inspect_zip { check:['canonical-form'], canonicalDate }'. It does not explicitly say when NOT to use it (e.g. versus create_zip or modify_zip for fresh archives), so it stops just short of the top band.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.