get_document_info

get_document_info returns the file type, page count, and format-specific structure without changing anything — the sensible check before watermarking a batch. Example prompt: “How many pages will this watermark cover?”

Tool description (as the AI agent sees it):

Returns the file type, page count, and format-specific properties of a document as JSON. Supports PDF, DOCX, XLSX, PPTX, PNG, JPG, and 50+ more document and image formats. Call this tool whenever the user asks about the structure of a document — page count, dimensions, file type — without modifying it. Useful as a precondition check before AddWatermark / SearchWatermarks (e.g. ‘how many pages does this PDF have?’). Do NOT pre-check whether the file exists — just pass the filename the user provided. Returns a JSON object with fields fileType (engine-reported format name), fileFormat (extension), size (bytes), pageCount, and pages (array of { number, width, height } per page). On failure, the response text starts with ‘Document-info lookup failed for’ followed by the underlying exception type, message, and inner-exception chain.

Parameters

NameTypeRequiredDescription
fileobjectyesFileInput shape
passwordstringnoPassword for protected documents

Example call

{
  "name": "get_document_info",
  "arguments": {
    "file": {
      "filePath": "contract.pdf"
    }
  }
}

Result

A JSON object with the file type, page count, and format-specific properties.

On failure the text starts with Document-info lookup failed for, followed by the exception type and message.

Example prompts

  • “How many pages does this document have?”
  • “What format is this file?”
  • “Check the structure before I watermark the folder.”