Skip to main content
Glama

Extract, reorder or delete PDF pages

extract_pdf_pages

Create a new PDF containing only selected pages in your chosen order. Extract ranges, reorder pages, or keep a subset without changing the original file.

Instructions

Write a new PDF containing only the listed pages, in the listed order. Use it to pull out a range, reorder pages ("3,1,2") or drop pages (list the ones to keep). Pages are 1-based; ranges like "1-3, 7" and reversed ranges like "5-1" work. Writes a new PDF and returns its path; the input is not modified and an existing file is never overwritten. To cut a PDF into equal parts use split_pdf instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputYesPath to the PDF.
pagesYesPages to keep, for example "1-3, 7" or "3,1,2".
outputNoWhere to write the result. Defaults to a new file beside the input. Existing files are never overwritten; a free name like file-1.pdf is used instead.
passwordNoPassword for a PDF that asks for one when opened. Used only on this machine.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A4.7/5.0
Behavior4/5

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

Annotations declare a write operation that is not destructive (readOnlyHint=false, destructiveHint=false), and the description explains why: a new file is written, the input is untouched, and existing files are never overwritten. It also states what is returned (the new path). It stops short of describing error behavior, e.g. what happens with an encrypted PDF when no password is supplied.

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?

Four tight sentences, front-loaded with the core action, then semantics, then side effects, then the sibling routing note. No filler and nothing repeated from the schema.

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?

With no output schema, the description supplies the return value (a path) and the non-destructive write contract. Combined with 100% parameter coverage, an agent has everything needed to invoke it 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 description coverage is 100%, so baseline is 3. The description adds genuine meaning beyond the schema: pages are 1-based, and reversed ranges like "5-1" are supported — neither of which appears in the schema's page description.

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 precise verb+resource+scope: 'Write a new PDF containing only the listed pages, in the listed order.' It names the three concrete use cases (range extraction, reordering, dropping pages) and explicitly distinguishes itself from the sibling split_pdf.

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 explicit when-to-use cases ('pull out a range, reorder pages, drop pages') and an explicit when-not with the named alternative: 'To cut a PDF into equal parts use split_pdf instead.' The routing decision is fully resolved without opening any schema.

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