Skip to main content
Glama

Split PDF into parts

pdf_split
DestructiveIdempotent

Split a PDF into multiple PDFs by explicit page ranges or fixed-size chunks, returning each part inline or saving them to an output directory.

Instructions

Split one PDF into several PDFs, either by explicit ranges (each comma group becomes one part: "1-2,3-5" gives two parts) or into fixed-size chunks (every=2 on 5 pages gives 1-2, 3-4, 5). Give exactly one of ranges or every. With output_dir the parts are written there as part-1.pdf, part-2.pdf, …; otherwise each part comes back inline as an application/pdf resource. Either way you also get a structured parts list (pages, page_count, bytes, and output_path or resource_uri). Existing part-N.pdf files with those names are overwritten, and part-N.pdf files from earlier runs in that directory are left as they are; the source is never modified. Limited to 100 parts and about 4 MB of total output; use pdf_extract_pages for a single range.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "pdf_path": "<pdf_path>"
    },
    "name": "pdf_split"
  }
}

Input Schema

NameRequiredDescriptionDefault
everyNoChunk size in pages; the last part may be shorter
rangesNo1-based page spec; each comma group becomes one part, e.g. "1-2,3-5"
passwordNoPassword to open the input, only needed for a user-password PDF (owner-locked files with an empty user password open without it).
pdf_pathYesPDF source: a path to a .pdf file inside the allowed directories (PDFOPS_ROOT, default the working directory), an https:// URL, or a data:application/pdf;base64,… URI. Use a URL or data URI when this server runs remotely (Smithery, hosted gateways) where local paths do not exist.
output_dirNoPath of an existing directory inside the allowed directories (PDFOPS_ROOT, default the working directory) to write part-1.pdf, part-2.pdf, … into. Omit when running remotely: the parts are then returned inline as application/pdf resources.

Output Schema

NameRequiredDescriptionDefault
countYesNumber of parts produced
partsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.5.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and idempotentHint=true, but the description goes further: it discloses that existing part-N.pdf files are overwritten while stale parts from earlier runs persist, that the source is never modified, and that the operation is capped at 100 parts / ~4 MB. That overwrite-versus-stale distinction is exactly the kind of context annotations cannot convey. It stops short of describing failure modes (e.g., what error surfaces when both ranges and every are supplied) or how the cap is enforced, keeping it just below a 5.

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?

The mode definitions and exclusivity rule are front-loaded, and nearly every clause carries operative information (limits, overwrite behavior, output naming, return type). It is a single dense paragraph with a few run-on clauses around the overwrite/stale-part distinction that could be split for faster scanning.

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 five-parameter mutation tool with a full schema and an output schema, this covers everything an agent needs: mode exclusivity, return channel (inline resource vs. file path), the structured parts list, side effects on disk, and hard limits. Returns are described briefly even though the output schema would suffice.

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 baseline is 3, but the description adds interaction semantics the schema cannot express: how each comma group maps to a part, how a short trailing chunk is handled ("every=2 on 5 pages gives 1-2, 3-4, 5"), and the concrete naming and return shape for output_dir. The password parameter is left entirely to the schema, which is acceptable given its self-documenting text.

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?

Opens with a specific verb and resource ("Split one PDF into several PDFs") and immediately enumerates the two operating modes (explicit ranges vs. fixed-size chunks). It also names the sibling it is not — pdf_extract_pages — so an agent can distinguish scope without opening either schema.

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?

Gives an explicit exclusivity rule ("Give exactly one of ranges or every"), explains when to use output_dir versus omitting it, and routes single-range work to pdf_extract_pages. Both the selection condition and the alternative are stated, not implied.

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