{
  "name": "remote-file-hash",
  "summary": "Computes the sha256, sha1 or md5 digest of a remote file, buffered in memory under a size cap, for checksum verification.",
  "rationale": "Verifying an artefact against a published checksum means pulling the whole file through a hardened fetch and hashing it. An agent that fetches the URL itself walks past every SSRF control and pays the bandwidth anyway.",
  "family": "archives",
  "price_usd": "0.003",
  "free": false,
  "timeout_ms": 60000,
  "max_timeout_seconds": 81,
  "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 file, up to 2048 characters; redirects are followed and the digest is taken over the whole response body (after any HTTP content-encoding is decoded), which must be at most 100 MB."
      },
      "algorithm": {
        "default": "sha256",
        "description": "Digest to compute over the bytes: sha256 (default), sha1 or md5, returned as lowercase hex.",
        "type": "string",
        "enum": [
          "sha256",
          "sha1",
          "md5"
        ]
      }
    },
    "required": [
      "url"
    ],
    "additionalProperties": false
  },
  "input_example": {
    "url": "https://grist.tools/samples/archives/bundle.zip",
    "algorithm": "sha256"
  },
  "output_example": {
    "source_url": "https://grist.tools/samples/archives/bundle.zip",
    "bytes": 639,
    "algorithm": "sha256",
    "hash": "07af68ae7f049cf267c89c4c89df15fd1f59153773b308ea6bb7bb0d0585e5c3"
  },
  "errors": [
    "invalid_input",
    "blocked_target",
    "unreachable_target",
    "upstream_timeout",
    "too_large",
    "unprocessable",
    "internal"
  ]
}