get_document_info

View as MarkdownMarkdown

Set up your AI agent

Give your coding agent live access to the GroupDocs documentation and API reference through the GroupDocs Docs MCP server — no install, no API key. Learn more

claude mcp add --transport http groupdocs-docs https://docs.groupdocs.com/mcp

Also process documents locally

The GroupDocs.Metadata MCP server lets your agent work with files on your machine; they are never uploaded. It needs the .NET 10 SDK or Docker.

claude mcp add groupdocs-metadata -- dnx GroupDocs.Metadata.Mcp --yes
Folders, licensing and more →

get_document_info returns the file type, size, page count, and encryption status without enumerating properties. It is the cheap triage call: what is this file, and can it even be opened? Example prompt: “Is this PDF encrypted?”

Tool description (as the AI agent sees it):

Returns the file type, size, page count, and encryption status of a document as JSON — a lightweight structural check that does NOT enumerate metadata properties (use ReadMetadata for that). Supports PDF, DOCX, XLSX, PPTX, JPEG, PNG, TIFF, MP3, MP4, WAV, AVI, and 50+ more document, image, and media formats. Call this tool whenever the user asks about a document’s format, page count, byte size, or whether it is encrypted, without needing the full metadata dump. Do NOT pre-check whether the file exists — just pass the filename the user provided. Returns a JSON object with fields fileName, fileFormat (engine-reported format name), mimeType, pageCount, sizeBytes, and isEncrypted. 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
fileobjectyesThe document — see FileInput shape
passwordstringnoPassword for protected documents

Example call

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

Result

A JSON object with the file type, size, page count, and encryption status.

The encryption flag is the useful one here: it explains why a metadata read might fail, and it lets an agent ask you for the password instead of guessing.

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

Example prompts

  • “Is this PDF encrypted?”
  • “What type and size is this file?”
  • “How many pages, before I process the batch?”