Skip to main content
Glama

Extract PDF pages

extract_pdf_pages

Copies selected pages from a PDF into a new PDF in the order you specify, leaving the original unchanged. Use it to keep only the pages you need.

Instructions

Copy chosen pages of a PDF into one new PDF, in the order typed ("3, 1-2" puts page 3 first). Use this to keep some pages; to drop pages use delete_pdf_pages, and for many output files use split_pdf. Returns the saved path and page count. The input is not changed; give the password for an encrypted PDF.

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": {
      "file": "<file>",
      "pages": "<pages>"
    },
    "name": "extract_pdf_pages"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileYesPath to the file (absolute, or relative to the working directory).
pagesYesPages to keep, like "1-3, 8" (a trailing "-" means to the end).
outputNoWhere to save the result. Defaults to a new file next to the input.
passwordNoThe PDF's current password, if it has one.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

Adds real behavior beyond the annotations: the source file is left unchanged (clarifying the readOnlyHint=false / destructiveHint=false combination), the return values are the saved path and page count, and a password is required for encrypted PDFs. It does not say what happens if the output path already exists or why idempotentHint is false, which is the remaining gap for a write tool.

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 compact sentences, front-loaded with the action, then ordering semantics, then routing to siblings, then return values and safety. No sentence is redundant with another or with the schema.

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

Completeness4/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 correctly compensates by naming the return values, and it covers the mutation, password, and sibling-selection concerns. The only missing piece an agent might want is what happens when the destination file already exists.

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 four parameters, making 3 the baseline. The description does add one thing the schema omits — that output page order follows the order typed — plus password guidance, but it says nothing about the 'output' parameter's collision/overwrite behavior.

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 ('Copy chosen pages of a PDF into one new PDF') and immediately differentiates itself from delete_pdf_pages and split_pdf by what it does rather than by name alone. The ordering example ('3, 1-2' puts page 3 first) further pins down the exact behavior.

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?

Explicitly names the alternative for each adjacent intent: 'to drop pages use delete_pdf_pages' and 'for many output files use split_pdf'. The positive case ('Use this to keep some pages') is stated up front, so the agent has both when-to-use and when-not-to-use guidance.

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