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.Watermark 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-watermark -- dnx GroupDocs.Watermark.Mcp --yes
Folders, licensing and more →

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
fileobjectyesThe document — see FileInput 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.”