Skip to main content
Glama
shuji-bonji

pdf-writer-mcp

by shuji-bonji

Extract Pages

extract_pages
Idempotent

Extract selected pages from a PDF into a new file, preserving or reordering them as specified; output can be saved or returned as base64.

Instructions

Create a new PDF containing only the given pages. The given order is preserved, so extraction doubles as reordering. Pages are copied into a new document, so document-level information (tagged structure, XMP, attachments, AcroForm, bookmarks, etc.) is not carried over. Anything lost is reported in warnings; follow up on the output with attach_file / ensure_tagged / add_bookmarks / set_metadata as needed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pagesYesPages to extract, "1,3-5,8-" (1-based). The given order becomes the output order.
inputPathYesAbsolute path of the target PDF.
outputPathNoDestination file path (absolute). When omitted, a base64 string is returned instead.
returnBase64NoWhen true, include a base64 string in the result in addition to saving.
allowBreakingSignaturesNoWhen the target is digitally signed (detected via /ByteRange), the default is an error. Set true to proceed, accepting that the signatures become invalid.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.21.2

TDQS

A4.1/5.0
Behavior5/5

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

Goes beyond annotations by disclosing that document-level information (tagged structure, XMP, attachments, AcroForm, bookmarks) is stripped, that losses are surfaced in warnings, and that follow-up tools may be needed. This is valuable and consistent with idempotentHint=true, readOnlyHint=false, and destructiveHint=false.

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 sentences with the core purpose first, then behavioral caveats, then actionable follow-up. No filler; each sentence adds unique information.

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 5-param tool with no output schema, the description plus fully documented schema covers the outcome, side effects, warnings, and follow-up. Missing explicit sibling differentiation is a usage gap, but not a completeness gap for calling the tool 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?

The schema description coverage is 100% with detailed descriptions for all five parameters, so baseline is 3. The description reiterates the pages-order concept but doesn't add new parameter semantics beyond what the schema already provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific action ('Create a new PDF') and resource ('only the given pages'), and adds the order-preservation detail. It is clear but does not explicitly name or contrast sibling tools such as split_pdf/delete_pages/reorder_pages, so it earns 4 rather than 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies when to use it: to extract a subset of pages, and explicitly notes that order preservation means it can also reorder. It provides no explicit when-not-to-use or alternatives, and the follow-up guidance is after-use rather than tool-selection guidance.

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