Skip to main content
Glama
shuji-bonji

pdf-writer-mcp

by shuji-bonji

Reorder Pages

reorder_pages
Idempotent

Rearrange PDF pages by providing a new 1-based page sequence. Copies pages into a new document and reports lost metadata, bookmarks, or forms for follow-up.

Instructions

Reorder pages. order must list every page exactly once, in the new order. 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
orderYesNew page order (1-based). Example: [5,4,3,2,1] reverses a 5-page document.
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.6/5.0
Behavior5/5

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

The description explicitly discloses that pages are copied into a new document, that document-level information such as tagged structure, XMP, attachments, AcroForm, and bookmarks is not carried over, and that lost items are reported in warnings. This goes well beyond what the annotations provide and helps the agent anticipate important side effects.

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?

The description is concise, front-loaded with the core operation, and every sentence carries meaningful guidance. It communicates the requirement, the data-loss behavior, and the remediation steps in three sentences without redundancy.

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?

The tool has five parameters but the schema fully documents them, while the description covers the main behavioral caveat and follow-up actions. There is no output schema, but the description mentions warnings, and the returnBase64/outputPath parameter descriptions clarify output behavior. Minor gaps such as return-value detailing are adequately covered by schema and context.

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 description coverage is 100%, so parameter names and types are already documented. The description adds crucial semantics not enforced by the schema—that 'order' must be a permutation listing every page exactly once—which is essential for calling the tool correctly.

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?

The description states the specific operation ('Reorder pages') and the essential constraint on the 'order' array (every page exactly once). This clearly distinguishes the tool from sibling operations like rotate_pages, extract_pages, and delete_pages.

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

Usage Guidelines4/5

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

The description gives clear context for use: reordering pages in a new document and following up with other tools to restore lost document-level features. It does not explicitly state when not to use this tool versus alternatives, but the lossiness caveat effectively communicates the tradeoff.

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