Skip to main content
Glama
zipnative-mcp

zipnative-mcp

Read one entry (random access)

read_zip_entry
Read-onlyIdempotent

Read a single ZIP entry without extracting the archive by exact name or central-directory index, returning decompressed data, raw compressed bytes, or CRC and size verification.

Instructions

Read ONE entry without extracting the archive, by name (exact; the last duplicate wins) or index (central-directory position — disambiguates duplicates). mode 'data' (default): decompressed content as base64 or UTF-8 text (encoding:'utf8'; ENTRY_NOT_UTF8 otherwise), CRC-verified; a range {offset,length} reads a byte window through the chunked stream (bounded memory, no CRC). mode 'raw': the compressed payload verbatim (feed it to inflate_raw). mode 'verify': CRC / size / local-header agreement only. Inline cap 16 MiB per entry (ENTRY_TOO_LARGE → use a range or extract_zip file mode). Encrypted entries → ZIP_UNSUPPORTED_ENCRYPTION (no decryption in this engine).

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": "read_zip_entry"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeNo'data' (default): decompressed content; 'raw': the compressed payload bytes verbatim (zero-copy, no decompression); 'verify': CRC / size / local-header check only, no payload.data
nameNoEntry name (exact, case-sensitive; the LAST duplicate wins). Exclusive with index.
indexNoCentral-directory position (from list_zip_entries) — disambiguates duplicate names. Exclusive with name.
rangeNoRead only a byte window of the decompressed content through the chunked stream (bounded memory; CRC is not verified for a window). length ≤ 16777216.
accessNo'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
fieldsNoDot-paths to keep, after verbosity (e.g. ['entryCount', 'entries.name']); unmatched ones are listed in _meta.unmatchedFields.
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.
encodingNoContent encoding for mode 'data': base64 (default) or UTF-8 text (invalid UTF-8 → ENTRY_NOT_UTF8).base64
verbosityNo'summary': scalar verdict fields only (the token-frugal form).full
verifyCrcNoVerify the decompressed CRC-32 against the central directory (mode data, no range).
zipBase64NoArchive bytes, base64 (≤ 128 MiB decoded). Exclusive with zipPath.
includeUnixIdsNoAdd the entry's `unixIds` (zipnative getUnixIds: the Info-ZIP ux uid / gid, or null).
includeExtendedTimestampsNoAdd the entry's `extendedTimestamps` (zipnative getExtendedTimestamps: UT, then NTFS, then the DOS fields; ISO-8601, UTC).

Output Schema

NameRequiredDescriptionDefault
modeNo
nameNosummary only: the entry name.
textNo
entryNo
indexNosummary only: the entry index.
rangeNo
accessNoPresent when the archive was read by byte ranges (access 'range', or a zipPath above the in-memory cap).
encodingNo
sizeBytesNoBytes returned (data / raw) or the declared uncompressed size (verify).
dataBase64No
textLengthNo
crcVerifiedNo
diagnosticsNoNon-fatal engine concerns (de-duplicated by code + entry, ≤ 200; codes in describe_engine.diagnosticCodes). Empty for a clean archive.
verificationNo
diagnosticCountNosummary only: number of distinct diagnostics.
diagnosticCountsNoOccurrences per code, duplicates included.
diagnosticsTruncatedNotrue when rows beyond 200 were dropped.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed28 schema fields changedv1.0.1
    • addedInput schema / properties / access
      Added value: +{
      +  "default": "auto",
      +  "description": "'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).",
      +  "enum": [
      +    "auto",
      +    "memory",
      +    "range"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / fields / description
      Previous value: -"Dot-path projection applied after verbosity (e.g. ['entryCount', 'entries.name']); array segments map over elements; unmatched paths are reported in _meta.unmatchedFields."New value: +"Dot-paths to keep, after verbosity (e.g. ['entryCount', 'entries.name']); unmatched ones are listed in _meta.unmatchedFields."
    • addedInput schema / properties / fields / items / pattern
      Added value: +"^(?!(?:[^.]*\\.)*(?:__proto__|constructor|prototype)(?:\\.|$)).+$"
    • addedInput schema / properties / includeExtendedTimestamps
      Added value: +{
      +  "default": false,
      +  "description": "Add the entry's `extendedTimestamps` (zipnative getExtendedTimestamps: UT, then NTFS, then the DOS fields; ISO-8601, UTC).",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / includeUnixIds
      Added value: +{
      +  "default": false,
      +  "description": "Add the entry's `unixIds` (zipnative getUnixIds: the Info-ZIP ux uid / gid, or null).",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / limits / description
      Previous value: -"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."New value: +"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."
    • changedInput schema / properties / limits / properties / maxCentralDirectoryBytes / description
      Previous value: -"Maximum central-directory size in bytes."New value: +"Bytes."
    • changedInput schema / properties / limits / properties / maxCommentBytes / description
      Previous value: -"Maximum comment length in bytes."New value: +"Bytes."
    • changedInput schema / properties / limits / properties / maxCompressionRatio / description
      Previous value: -"Maximum declared uncompressed/compressed ratio for entries >= 1 KiB compressed (zip-bomb guard)."New value: +"Declared ratio (entries ≥ 1 KiB compressed)."
    • changedInput schema / properties / limits / properties / maxEntries / description
      Previous value: -"Maximum central-directory entry count."New value: +"Entries."
    • addedInput schema / properties / limits / properties / maxEntryCompressedSize
      Added value: +{
      +  "description": "Bytes, one compressed payload fetched by the byte-range reader (access range).",
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • changedInput schema / properties / limits / properties / maxEntryUncompressedSize / description
      Previous value: -"Maximum decompressed size of one entry, bytes."New value: +"Bytes, one entry decompressed."
    • changedInput schema / properties / limits / properties / maxExtraFieldBytes / description
      Previous value: -"Maximum extra-field block length in bytes."New value: +"Bytes."
    • changedInput schema / properties / limits / properties / maxNameBytes / description
      Previous value: -"Maximum entry-name length in bytes."New value: +"Bytes."
    • changedInput schema / properties / limits / properties / maxTotalUncompressedSize / description
      Previous value: -"Maximum total decompressed size across an extraction, bytes."New value: +"Bytes, all entries decompressed."
    • changedInput schema / properties / strict / description
      Previous value: -"Escalate the first engine diagnostic (prepended data, duplicate name, name mismatch, …) to a ZIP_STRICT_DIAGNOSTIC error instead of reporting it."New value: +"Turn the first engine diagnostic into a ZIP_STRICT_DIAGNOSTIC error."
    • changedInput schema / properties / verbosity / description
      Previous value: -"'summary' returns only the scalar verdict fields (drops arrays and payloads) — the token-frugal form."New value: +"'summary': scalar verdict fields only (the token-frugal form)."
    • changedInput schema / properties / zipBase64 / description
      Previous value: -"The archive bytes as base64 (exactly once; a data: URI prefix is tolerated). Exclusive with zipPath. Decoded size ≤ 128 MiB."New value: +"Archive bytes, base64 (≤ 128 MiB decoded). Exclusive with zipPath."
    • changedInput schema / properties / zipPath / description
      Previous value: -"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."New value: +"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."
    • addedOutput schema / properties / access
      Added value: +{
      +  "description": "Present when the archive was read by byte ranges (access 'range', or a zipPath above the in-memory cap).",
      +  "enum": [
      +    "range"
      +  ],
      +  "type": "string"
      +}
    • changedOutput schema / properties / diagnosticCounts / description
      Previous value: -"Number of diagnostics received per code (counts every occurrence, including de-duplicated ones)."New value: +"Occurrences per code, duplicates included."
    • changedOutput schema / properties / diagnostics / description
      Previous value: -"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."New value: +"Non-fatal engine concerns (de-duplicated by code + entry, ≤ 200; codes in describe_engine.diagnosticCodes). Empty for a clean archive."
    • changedOutput schema / properties / diagnosticsTruncated / description
      Previous value: -"Present (true) when more than 200 distinct diagnostics were dropped from `diagnostics`."New value: +"true when rows beyond 200 were dropped."
    • addedOutput schema / properties / entry / properties / extendedTimestamps
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "With includeExtendedTimestamps: modification / access / creation instants (ISO-8601, UTC) from the UT (0x5455) extra, else the NTFS (0x000a) extra, else the DOS fields (source names which); a missing one is null.",
      +  "properties": {
      +    "atime": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "ctime": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "mtime": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "source": {
      +      "enum": [
      +        "ut",
      +        "ntfs",
      +        "dos"
      +      ],
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
    • changedOutput schema / properties / entry / properties / nameEncoding / enum
      Previous value: -[
      -  "utf-8",
      -  "cp437"
      -]New value: +[
      +  "utf-8",
      +  "cp437",
      +  "custom"
      +]
    • addedOutput schema / properties / entry / properties / unixIds
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "With includeUnixIds: the Unix owner uid / gid from the Info-ZIP ux (0x7875) extra; null when the archive carries none.",
      +  "properties": {
      +    "gid": {
      +      "minimum": 0,
      +      "type": "integer"
      +    },
      +    "uid": {
      +      "minimum": 0,
      +      "type": "integer"
      +    }
      +  },
      +  "type": [
      +    "object",
      +    "null"
      +  ]
      +}
    • addedOutput schema / properties / verification / properties / localHeaderMatch / description
      Added value: +"The local header agrees with the central directory — cross-checked for every entry, encrypted ones included (zipnative 1.1.0)."
    • addedOutput schema / properties / verification / properties / skipped
      Added value: +{
      +  "description": "Why the payload was not verified; absent when it was.",
      +  "enum": [
      +    "encrypted",
      +    "stream-only-codec",
      +    "unsupported-method"
      +  ],
      +  "type": "string"
      +}
  2. First observedv1.0.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already mark it read-only, idempotent, and non-destructive, but the description adds important behavioral context: the 16 MiB inline cap, CRC behavior by mode, bounded-memory range reads, and the `ZIP_UNSUPPORTED_ENCRYPTION` outcome. These are exactly the operational details an agent needs beyond the safety annotations.

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 dense but front-loaded and organized around the tool's three modes. Every sentence contributes operational guidance, error handling, or selection rules, with no filler.

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?

Given the rich schema, annotations, and output schema, the description is complete enough for correct invocation. It covers the main failure modes, mode differences, memory bounds, encryption limitation, and fallback alternatives without needing to restate every parameter.

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 schema already explains all 15 parameters in detail. The description reinforces key cross-parameter behavior such as `name` vs `index`, `encoding` error handling, and range-vs-CRC semantics, but it does not meaningfully document many remaining parameters like `access`, `limits`, `fields`, or `strict` beyond what the schema provides.

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 states a specific verb and resource: read ONE entry without extracting the archive. It immediately disambiguates selection by exact `name` or central-directory `index`, distinguishing this from archive-wide tools like `list_zip_entries` or `extract_zip`.

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?

It gives explicit mode selection guidance for `data`, `raw`, and `verify`, plus concrete alternatives: use a range or `extract_zip` file mode when the inline cap is exceeded, and feed `raw` output to `inflate_raw`. It also states encrypted entries are unsupported, preempting a common failure case.

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