Skip to main content
Glama
sandraschi

pdf-mcp

pdf_manipulate

Merge, split, rotate, reorder, delete, compress, encrypt, decrypt, and optimize PDF files. Modify PDF structure and properties to prepare documents for sharing or storage.

Instructions

Modify PDF structure and properties.

Merge, split, rotate, reorder, delete pages, compress, encrypt/decrypt, and optimize PDFs.

Return Format

A dict with keys:

  • success: bool - whether the operation succeeded

  • message: str - human-readable summary

  • operation-specific keys:

    • merge: {path, pages}

    • split: {files: [path, ...]}

    • rotate/reorder/delete_pages/encrypt/decrypt: {path}

    • compress: {path, original_size, compressed_size}

    • optimize: {path, original_size, optimized_size} On failure: {success: False, error, error_type}.

Examples

await pdf_manipulate(operation="merge", path="a.pdf", paths=["a.pdf", "b.pdf"]) {"success": true, "path": ".../merged_....pdf", "pages": 4, "message": "Merged 2 PDFs into merged_....pdf (4 pages)."}

await pdf_manipulate(operation="rotate", path="report.pdf", angle=90) {"success": true, "path": ".../report_rotate_....pdf", "message": "Rotated report.pdf by 90 degrees, saved to report_rotate_....pdf."}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesPath to the PDF file. Ignored for merge.
angleNoRotation angle in degrees. Default 90.
pagesNoPage range string (e.g. '1-5,7,9-12'). For rotate operation.
pathsNoList of PDF paths to merge. Only for merge operation.
rangesNoSplit ranges as list of [start, end] pairs (1-indexed).
qualityNoCompression quality 1-100. Default 85.
passwordNoPassword for encrypt/decrypt operations.
new_orderNoNew page order (1-indexed list). For reorder operation.
operationYes
page_listNoList of page numbers to delete. For delete_pages operation.
output_dirNoOutput directory for split operation.
output_pathNoOutput path. Auto-generated if omitted.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageNoHuman-readable summary
successNoWhether the operation succeeded

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.1

TDQS

A3.8/5.0
Behavior4/5

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

Annotations only declare readOnlyHint=false and openWorldHint=true, so the description carries real weight and does so: it discloses that outputs are written to auto-generated new files (e.g., 'saved to report_rotate_....pdf') rather than mutating in place, and it documents failure shape via {success: False, error, error_type}. It does not mention permission requirements or that encrypt/decrypt need a password, but the operation-level output mapping is genuinely additive.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loading is good and the headers make it scannable, but the entire '## Return Format' section duplicates the output schema that already exists, so a large share of the text does not earn its place. The two examples are useful and worth keeping; the key-by-key return listing is not.

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?

For a 12-parameter, nine-operation tool with an output schema and strong schema coverage, the description supplies the operation inventory and concrete invocation examples, which is close to sufficient. The remaining gap is the absence of any guidance on choosing among sibling PDF tools and on output_path vs output_dir behavior.

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 already 92%, so the baseline is 3, and the worked examples push it higher by showing real parameter combinations (operation+path+paths for merge, operation+path+angle for rotate). The return-format section also ties each operation to the fields it consumes, which the schema does not do in one place.

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+resource ('Modify PDF structure and properties') and then enumerates all nine concrete operations, which cleanly separates it from siblings like pdf_convert, pdf_extract, pdf_annotate, and pdf_redact. An agent can identify the tool's scope without opening the schema.

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

Usage Guidelines2/5

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

The description never says when to choose pdf_manipulate over pdf_convert, pdf_do, or pdf_annotate, nor does it state prerequisites or when-not to use it. The operation list implies usage, but no routing guidance or exclusions are given despite 15 sibling tools existing.

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