Skip to main content
Glama

Delete PDF pages

delete_pdf_pages

Remove selected pages from a PDF and save a new file while preserving the order of all remaining pages. The original document stays unchanged.

Instructions

Save a new PDF without the listed pages; all other pages keep their order. Use this to drop pages; to keep only a few use extract_pdf_pages. Returns the saved path and remaining page count. The input is not changed, and deleting every page is refused.

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": "delete_pdf_pages"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileYesPath to the file (absolute, or relative to the working directory).
pagesYesPages to delete, 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.5/5.0
Behavior4/5

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

Adds real behavior beyond the annotations: the input file is untouched, a new file is written, the return value is the saved path plus remaining page count, and the all-pages edge case is refused. That explains the non-destructive framing implied by destructiveHint=false. It does not mention password handling or what happens on an invalid page range, so it falls just short of full disclosure.

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 short sentences, front-loaded with the primary effect, then the sibling routing, then the return/guardrail facts. No filler or redundant restatement of the title.

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 4-parameter file-rewriting tool with no output schema, the description covers the mutation model, the return values, the edge-case refusal, and the alternative tool. Nothing an agent needs in order to invoke it correctly is missing.

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 description coverage is 100%, so file, pages, output, and password are already documented, including the '1-3, 8' page syntax. The description only reinforces that output is a new file by default; with the schema doing the heavy lifting, 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 ('Save a new PDF without the listed pages') plus the key invariant ('all other pages keep their order'), which makes it immediately distinguishable from extract_pdf_pages and reorder_pdf_pages.

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 selection rule: use this to drop pages, and route to extract_pdf_pages when the intent is to keep only a few. The condition that selects the alternative is stated, not implied.

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