{
  "name": "pdf-metadata",
  "summary": "Reads a PDF's page count, document-info fields, version and encryption flag without rendering it.",
  "rationale": "Reading a PDF trailer needs a real PDF parser and a hardened fetch: an agent that pulls the URL itself walks past every SSRF control, and carrying a PDF library per call is not something an agent does inline.",
  "family": "documents",
  "price_usd": "0.005",
  "free": false,
  "timeout_ms": 25000,
  "max_timeout_seconds": 46,
  "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 PDF, up to 2048 characters; redirects are followed, the body must start with %PDF-, and an encrypted file is still described without being decrypted."
      }
    },
    "required": [
      "url"
    ],
    "additionalProperties": false
  },
  "input_example": {
    "url": "https://grist.tools/samples/documents/metadata-brochure.pdf"
  },
  "output_example": {
    "source_url": "https://grist.tools/samples/documents/metadata-brochure.pdf",
    "bytes": 1010,
    "version": "1.7",
    "pages": 1,
    "encrypted": false,
    "title": "Sample Brochure",
    "author": "Grist Samples",
    "subject": "Public test document",
    "keywords": "sample metadata test",
    "creator": "grist.tools",
    "producer": "grist.tools",
    "creation_date": "2000-01-01T00:00:00.000Z",
    "modification_date": "2000-01-01T00:00:00.000Z"
  },
  "errors": [
    "invalid_input",
    "blocked_target",
    "unreachable_target",
    "upstream_timeout",
    "unsupported_content_type",
    "too_large",
    "unprocessable",
    "internal"
  ]
}