How to extract pages from many documents at once

“Get me the first page of every one of these” is a folder-sized task that takes one prompt.

Note
The commands and config snippets on this page are for the .NET build of the server — the only platform available today. Installation and client setup: MCP server for .NET. Other platforms will expose the same tools with their own launch command; everything else on this page applies unchanged.

Setup

Point GROUPDOCS_MCP_STORAGE_PATH at the folder (configuration). Files are resolved by name, so the agent passes invoice-014.pdf, not a path from your machine.

The prompt

Extract page 1 from every PDF in my documents folder and list what you produced.

The agent calls split per file. Each call writes a single-page document, so a folder of 40 invoices yields 40 cover pages.

Variations that come up

Extract the last page of each document — check the page count first. Pull page 2 out of every contract, then merge all of them into one review file. For each file, extract the signature page and put the results in the output folder.

The second one chains straight into merge in rounds of four — a single combined document from one page of each source.

Ask for the page count when the position is relative

“The last page” is a different number in every file. Have the agent call get_document_info per document first; an agent that guesses will fail on the files where the guess is wrong, and the error is per file rather than fatal.

Keep the output separate

Forty extracted pages beside forty originals is a folder nobody can navigate. Set GROUPDOCS_MCP_OUTPUT_PATH to a distinct directory (configuration) so results land apart from sources.

Practical notes

  • Failures are per file. A corrupt or password-protected document fails its own call; ask for the failures as a list so a batch of 40 does not hide two errors.
  • Metered usage adds up. Under metered licensing every call is billed processing.
  • Evaluation mode trims merged output to three pages — extraction of single pages is unaffected, but the moment you merge the results, the cap applies.