Skip to main content
Glama

Split a PDF

split_pdf
Idempotent

Split a PDF into new files with a set number of pages each, naming them base-01.pdf, base-02.pdf, etc. Use it to cut long documents into equal parts without changing the original.

Instructions

Splits a PDF into new files of a given number of pages each (the last may be shorter), named -01.pdf, -02.pdf, ... in an existing folder, and lists them. Use it to cut a long document into equal parts; for chosen pages or a different order, use extract_pages. The original is not changed; if any of the files exists, nothing is written unless overwrite is true. Encrypted PDFs cannot be split.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute path of the PDF.
passwordNoPassword, if the PDF is encrypted. Without it an encrypted PDF cannot be opened; with it, it can be read, but tools that write a new PDF cannot save it.
base_nameNoStart of the file names (default: the PDF's name).
overwriteNoAllow replacing an existing file (default false).
output_dirYesAbsolute path of an existing folder for the new files.
pages_per_fileYesPages in each file (at least 1).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.0.9
    • changedInput schema / properties / password / description
      Previous value: -"Password, if the PDF is encrypted."New value: +"Password, if the PDF is encrypted. Without it an encrypted PDF cannot be opened; with it, it can be read, but tools that write a new PDF cannot save it."
  2. Added

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations only declare the safety profile (readOnly false, idempotent, non-destructive); the description goes well beyond that by disclosing that the original is unchanged, that nothing is written if any target file exists unless overwrite is true, and that encrypted PDFs cannot be split. These are exactly the failure/idempotency behaviors an agent needs.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads the core action and keeps the alternative-tool guidance and the caveats in compact clauses. It is dense but every clause carries information; only the parenthetical about the shorter last file borders on the obvious.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a write tool with no output schema, the description covers what is produced (named files and a listing), where it goes, the overwrite/atomicity rule, and the encryption limitation, leaving no material gap for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3; the description adds value by clarifying the naming derivation (base-01, base-02, ...) and tying overwrite to the all-or-nothing write behavior, though it does not elaborate on password or pages_per_file beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource (splits a PDF), plus the exact output shape (new files of N pages each, last may be shorter) and even the naming convention <base>-01.pdf. It explicitly contrasts itself with the sibling extract_pages, so an agent can distinguish the two without opening the schemas.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Names the scenario it is for ('cut a long document into equal parts') and the alternative for a different need ('for chosen pages or a different order, use extract_pages'), plus the precondition that the output folder must already exist.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.