{
  "id": "text.hash",
  "object": "tool",
  "name": "Hash",
  "summary": "SHA-256, SHA-512, HMAC, MD5.",
  "description": "Hashes text or a file with SHA-1, SHA-256, SHA-384, SHA-512 or MD5 (for checksums only), or computes an HMAC with a key. Returns hex and base64 for each.",
  "category": "utility",
  "hosted_by": "Opentools",
  "runtime": "worker",
  "side_effects": false,
  "status": "live",
  "credits": 0,
  "price": "$0.0000",
  "providers": [
    {
      "id": "opentools",
      "name": "Opentools",
      "price": "$0.0000"
    }
  ],
  "mcp_name": "text_hash",
  "input_schema": {
    "type": "object",
    "properties": {
      "text": {
        "description": "Text to hash (UTF-8)",
        "type": "string",
        "maxLength": 20000000
      },
      "file": {
        "description": "A file to hash, instead of text",
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "url": {
                "type": "string",
                "format": "uri",
                "description": "Public http(s) URL of the file"
              }
            },
            "required": [
              "url"
            ]
          },
          {
            "type": "object",
            "properties": {
              "file_id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                "description": "An id returned by POST /v1/files"
              }
            },
            "required": [
              "file_id"
            ]
          },
          {
            "type": "object",
            "properties": {
              "base64": {
                "type": "string",
                "description": "Base64-encoded file bytes (up to 10 MB)"
              },
              "name": {
                "type": "string",
                "description": "File name, e.g. invoice.pdf"
              },
              "content_type": {
                "type": "string"
              }
            },
            "required": [
              "base64",
              "name"
            ]
          },
          {
            "type": "object",
            "properties": {
              "connection": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "description": "A storage connection id or name (see storage.connections)"
              },
              "path": {
                "type": "string",
                "minLength": 1,
                "maxLength": 1024,
                "description": "Path of the file in that connection, e.g. reports/q3.pdf"
              }
            },
            "required": [
              "connection",
              "path"
            ]
          }
        ],
        "x-file": true
      },
      "algorithms": {
        "default": [
          "sha256"
        ],
        "description": "Algorithms to run",
        "minItems": 1,
        "maxItems": 5,
        "type": "array",
        "items": {
          "type": "string",
          "enum": [
            "md5",
            "sha1",
            "sha256",
            "sha384",
            "sha512"
          ]
        }
      },
      "hmac_key": {
        "description": "Compute an HMAC with this key instead of a plain hash",
        "type": "string",
        "maxLength": 10000
      },
      "key_encoding": {
        "default": "utf8",
        "description": "How hmac_key is written",
        "type": "string",
        "enum": [
          "utf8",
          "hex",
          "base64"
        ]
      }
    }
  },
  "kind": "tool"
}