get_document_info

get_document_info returns the file type, page count, size, and per-page dimensions of a document — without comparing anything. Agents use it to sanity-check a pair before a comparison (“are these even the same format?”). Example prompt: “How many pages does contract-v2.docx have?”

Tool description (as the AI agent sees it):

Returns file type, page count, file size, and per-page dimensions for a source document — without performing a comparison. Supports PDF, DOCX, XLSX, PPTX, ODT, RTF, TXT, HTML, and 30+ more document formats. Call this tool whenever the user asks to inspect a document, get document info, check file type, page count, or properties before deciding whether to compare. Do NOT pre-check whether files exist — just pass the filename the user provided. The tool resolves files from storage and returns an error with available files if a name is not found. Returns a JSON object with fileName, fileType (fileFormat + dot-prefixed extension, e.g. .pdf), pageCount, sizeBytes, and pages (per-page width/height). 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-v2.docx"
    }
  }
}

Result

A JSON object with fileName, fileType (fileFormat plus a dot-prefixed extension, e.g. .docx), pageCount, sizeBytes, and pages — width and height per page.

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

Example prompts

  • “How many pages does contract-v2.docx have?”
  • “What format is this file, and how big is it?”
  • “Check both versions are the same format before comparing them.”