split

split extracts the pages you name — pages: "3,6,8" — and saves each one as its own document. Example prompt: “Pull out pages 3, 6, and 8 as separate files.”

Tool description (as the AI agent sees it):

Splits a document by extracting specific pages, saving each extracted page as an individual document to storage. Supports PDF, DOCX, XLSX, PPTX, and 30+ more multi-page document formats. Call this tool immediately whenever the user asks to split, extract pages, or separate a document into parts. Do NOT pre-check whether files exist — just pass the filename the user provided. Pass page numbers as a comma-separated 1-based list, e.g. pages=‘3,6,8’. Returns a message (‘Split “” into N file(s):’) followed by the saved path of each extracted document. On failure, the response text starts with ‘Split failed for’ followed by the underlying exception type, message, and inner-exception chain.

Parameters

NameTypeRequiredDescription
fileobjectyesFileInput shape
pagesstringyesPage numbers to extract as separate documents (1-based), e.g. ‘3,6,8’
passwordstringnoPassword for protected documents

Example call

{
  "name": "split",
  "arguments": {
    "file": {
      "filePath": "report.pdf"
    },
    "pages": "3,6,8"
  }
}

Result

A message naming the extracted documents, one per requested page.

This is page extraction, not range splitting: three page numbers produce three single-page files, not one file containing those three pages. To get a single document with pages 3, 6 and 8, extract them and then merge the results — two prompts, and an agent will chain them if you ask.

Call get_document_info first if you are unsure how many pages exist; asking for page 12 of a ten-page document fails rather than silently returning less.

On failure the text starts with Split failed for, followed by the exception type and message.

Example prompts

  • “Pull out pages 3, 6, and 8 as separate files.”
  • “Extract the signature page from this contract.”
  • “Split out the first page of each of these documents.”

See it used end-to-end: Split and reassemble documents.