Skip to main content
Glama
Nizoka

pdfnative-mcp

Extract pages into one PDF

extract_pages
Idempotent

Extract selected pages from a source PDF into a new PDF with just those pages, in the order you specify. Trim large documents down to the essential pages you need.

Instructions

Keep an arbitrary pages[] subset (0-based, in the given order) in ONE fresh PDF. Same page-tree caveats as merge_pdfs (signatures/AcroForm/XMP dropped; boxes kept; URI links unless dropAnnotations). Encrypted sources: password; output unencrypted unless encrypt. Need several documents? Use split_pdf.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pagesYes0-based page indices to keep, in output order. Duplicates and out-of-range indices are rejected.
encryptNoRe-encrypt the output (Standard Security Handler; AES-128 default or AES-256; RC4 never emitted).
passwordNoPassword (user or owner) of an encrypted source. Never logged or echoed.
pdfBase64YesBase64-encoded source PDF. Pass `password` for an encrypted source.
outputModeNo'base64' (default) returns the PDF inline; 'file' writes it inside the PDFNATIVE_MCP_OUTPUT_DIR sandbox (SECURITY_VIOLATION when the sandbox is not configured).base64
outputPathNoRequired when outputMode='file'. Relative path inside the sandbox; must end with .pdf (no absolute paths, no '..').
dropAnnotationsNoWhen true, drop ALL annotations. Default keeps self-contained URI link annotations.
maxOutputSizeBytesNoMaximum size, in bytes, of the produced PDF. Defaults to 268435456 (256 MiB).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeYes
summaryNoTool-specific summary, when produced.
filePathNoSandboxed absolute path (file mode).
sizeBytesYes
diagnosticsNoPDF/A diagnostics (when includeDiagnostics=true).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added
  2. Removedv1.6.0
  3. Addedv1.2.2

TDQS

A4.9/5.0
Behavior5/5

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

The description discloses material side effects: signatures/AcroForm/XMP are dropped, boxes are kept, URI annotations persist unless dropAnnotations, and output is unencrypted unless encrypt is supplied. These go well beyond the annotations and give the agent the real behavior of the tool. There is no contradiction with the idempotentHint/destructiveHint annotations.

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

Conciseness5/5

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

The description is compact, front-loaded, and avoids duplicating the 8-parameter schema. It leverages the sibling merge_pdfs to inherit known caveats instead of repeating them, and every sentence contributes either a constraint, a behavior, or an alternative.

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?

Given a rich input schema with 100% coverage and a declared output schema, the description fills the remaining practical gaps: output freshness, encryption behavior, page-tree side effects, and the route to split_pdf. An agent has enough information to select and invoke this tool correctly.

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, and the description adds useful semantics on top: pages are order-preserving and 0-based, an encrypted source requires password, and output encryption happens only when encrypt is given. It does not restate every parameter, but the schema already documents those clearly.

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?

The description leads with a concrete action: keep an arbitrary 0-based pages[] subset in exactly one fresh PDF. It clearly distinguishes extract_pages from split_pdf and merge_pdfs and states a finite output scope. There is no ambiguity about the tool's object or effect.

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?

It explicitly routes to split_pdf when multiple output documents are needed, and it references merge_pdfs for shared behavior. It also gives the encrypted-source conditional: provide password, include encrypt if encrypted output is wanted. These are concrete when-to-use vs when-not-to-use signals.

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