Skip to main content
Glama

Delete pages from PDF

pdf_delete_pages
DestructiveIdempotent

Remove specified pages from a PDF and return the remaining pages in their original order. Use it to drop cover, blank, or sensitive pages while keeping the source file unchanged.

Instructions

Remove the listed pages from a PDF and return the remaining pages in their original order. Use this to drop a cover, blank or sensitive pages; use pdf_extract_pages when it is easier to name the pages to keep. Returns the result written to output_path, or inline as an application/pdf resource when output_path is omitted (results over 7 MB are never returned inline: pass output_path); an existing file at output_path is overwritten. The source is never modified. Deleting every page fails with no_pages_left.

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": {
      "pdf_path": "<pdf_path>",
      "pages": "<pages>"
    },
    "name": "pdf_delete_pages"
  }
}

Input Schema

NameRequiredDescriptionDefault
pagesYes1-based pages to REMOVE, e.g. "2,4-6,9-"
passwordNoPassword to open the input, only needed for a user-password PDF (owner-locked files with an empty user password open without it).
pdf_pathYesPDF source: a path to a .pdf file inside the allowed directories (PDFOPS_ROOT, default the working directory), an https:// URL, or a data:application/pdf;base64,… URI. Use a URL or data URI when this server runs remotely (Smithery, hosted gateways) where local paths do not exist.
output_pathNoPath of a .pdf file to write the result to, inside the allowed directories (PDFOPS_ROOT, default the working directory); an existing file there is overwritten. Omit when running remotely: the PDF is then returned inline as an application/pdf resource for the client to save.

Output Schema

NameRequiredDescriptionDefault
bytesYesSize of the produced PDF in bytes
output_pathNoAbsolute path written, when output_path was supplied
resource_uriNopdfops:// uri of the inline application/pdf resource, when output_path was omitted

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.5.0

TDQS

A4.9/5.0
Behavior5/5

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

Goes well beyond the annotations: the source is never modified, an existing output_path is overwritten, results over 7 MB are never returned inline, and the all-pages-deleted case fails with a named error. These are the exact side effects and limits an agent needs for a destructive 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?

Three sentences, front-loaded with the action and ordering guarantee, then routing to the sibling, then return/overwrite/error behavior. Every clause carries information; nothing is repeated from the annotations or 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?

Covers the mutation's side effects, the return channel, the size limit, and the failure mode, so an agent could invoke it correctly without further probing. The output schema existence doesn't leave a gap, since the description still summarizes where results land.

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; the description still adds meaning the schema lacks, namely the 7 MB inline-size threshold and the remote-vs-local rationale for omitting output_path. It does not restate the pages syntax or password semantics, which the schema already covers.

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 ('Remove the listed pages from a PDF') plus a guarantee about output ('return the remaining pages in their original order'), and explicitly contrasts with the sibling pdf_extract_pages. An agent can distinguish it from pdf_extract_pages without reading either 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 concrete use cases ('drop a cover, blank or sensitive pages') and names the alternative with the condition that selects it ('use pdf_extract_pages when it is easier to name the pages to keep'). Also states the failure condition ('Deleting every page fails with no_pages_left').

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