Skip to main content
Glama

Extract pages

extract_pages
Idempotent

Extract selected pages into a new PDF in the order you specify, or reorder pages without changing the original. Use overwrite: true to replace an existing output.

Instructions

Writes the chosen pages of a PDF to a new PDF, in the order given ("3,1" puts page 3 first). Use it to pull out or reorder pages; to cut a whole document into equal parts, use split_pdf. The original is not changed, and an existing output file is only replaced with overwrite: true. Fails with a message for an invalid or out-of-range page and for encrypted PDFs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute path of the PDF.
pagesYesPages to keep, in the order wanted, e.g. "3,1-2" (each page is written once; repeats are ignored).
outputYesAbsolute path of the new PDF. If the file exists, the call fails unless overwrite is true.
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.
overwriteNoAllow replacing an existing file (default false).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv1.0.9
    • changedInput schema / properties / output / description
      Previous value: -"Absolute path of the PDF to write."New value: +"Absolute path of the new PDF. If the file exists, the call fails unless overwrite is true."
    • changedInput schema / properties / pages / description
      Previous value: -"Pages to keep, e.g. \"1-3,5\"."New value: +"Pages to keep, in the order wanted, e.g. \"3,1-2\" (each page is written once; repeats are ignored)."
    • 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. First observedv1.0.6

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare the write/idempotent/non-destructive profile, but the description adds real value beyond them: the original file is untouched, an existing output is only replaced with overwrite:true, and it fails on invalid/out-of-range pages and encrypted PDFs. It doesn't say what error text or return value looks like, so it stops short of 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.

Conciseness5/5

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

Three dense sentences, front-loaded with the core behavior and ordering example before routing and failure modes. Every clause carries information; no filler.

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 local write tool with no output schema, the description covers mutation scope, overwrite semantics, ordering, sibling routing and failure modes such as encrypted PDFs. An agent has everything needed to call it correctly.

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

Parameters3/5

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

Schema coverage is 100%, so the schema already documents all five parameters including the pages syntax and overwrite default. The description reinforces ordering with the "3,1" example but adds no syntax or format detail the schema lacks, so the baseline 3 applies.

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 ('Writes the chosen pages of a PDF to a new PDF') plus the ordering semantics, and explicitly contrasts itself with the sibling split_pdf. An agent can distinguish it from merge_pdfs, rotate_pages and split_pdf without opening any 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 the positive use case ('use it to pull out or reorder pages') and names the exact alternative with its selecting condition ('to cut a whole document into equal parts, use split_pdf'). Nothing is left to inference.

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