{
  "name": "archive-extract-file",
  "summary": "Extracts one named entry from a remote zip, tar or tar.gz and returns its bytes (base64) with a sha256.",
  "rationale": "Pulling a single file out of an archive without unpacking the whole thing needs a real reader, a hardened fetch and the decompression-bomb care that caps a single entry twice, not something an agent should run inline.",
  "family": "archives",
  "price_usd": "0.003",
  "free": false,
  "timeout_ms": 90000,
  "max_timeout_seconds": 111,
  "input_schema": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "url": {
        "type": "string",
        "maxLength": 2048,
        "format": "uri",
        "description": "Absolute http(s) URL of the archive (at most 25 MB, also the cap on an inflated tar.gz), up to 2048 characters; redirects are followed and the format (zip, tar or gzip-compressed tar) is decided from the magic bytes, not the extension."
      },
      "entry": {
        "type": "string",
        "minLength": 1,
        "maxLength": 4096,
        "description": "Exact entry path to extract, 1 to 4096 characters, matched case-sensitively against the names archive-inspect lists; directories, links, encrypted entries and entries over 25 MB are refused."
      }
    },
    "required": [
      "url",
      "entry"
    ],
    "additionalProperties": false
  },
  "input_example": {
    "url": "https://grist.tools/samples/archives/bundle.zip",
    "entry": "data/squares.csv"
  },
  "output_example": {
    "source_url": "https://grist.tools/samples/archives/bundle.zip",
    "kind": "zip",
    "entry_name": "data/squares.csv",
    "size": 31,
    "compression": "deflate",
    "crc32": "89761172",
    "sha256": "202663eb5661a93d557520ce47e40bb6ccdcd7fded543fca46592d2291e2c8cf",
    "content_base64": "bixzcXVhcmUKMSwxCjIsNAozLDkKNCwxNgo1LDI1Cg=="
  },
  "errors": [
    "invalid_input",
    "blocked_target",
    "unreachable_target",
    "upstream_timeout",
    "unsupported_content_type",
    "too_large",
    "unprocessable",
    "internal"
  ]
}