Skip to main content
Glama
Nizoka

pdfnative-mcp

Merge PDFs

merge_pdfs
Idempotent

Combine 2–50 base64 PDFs into a single PDF. Supports encrypted password-protected sources, output encryption, and annotation handling.

Instructions

Concatenate 2–50 PDFs (pdfsBase64[]) into one fresh, self-contained document. Page-tree rebuild: signatures and AcroForm are dropped, XMP (and thus a PDF/A claim) does not survive — re-declare PDF/A on the generating tools; page boxes and /UserUnit do survive; URI links kept unless dropAnnotations:true. Encrypted sources open with one password (PASSWORD_REQUIRED / PASSWORD_INVALID); output unencrypted unless encrypt. Guards: 256 MiB assembly (maxOutputSizeBytes), 50 MiB output (OUTPUT_TOO_LARGE).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
encryptNoRe-encrypt the output (Standard Security Handler; AES-128 default or AES-256; RC4 never emitted).
passwordNoPassword applied to every encrypted source (pdfnative v1.6.0). Sources with an empty user password open without it. The merged output is unencrypted unless `encrypt` is set.
outputModeNo'base64' (default) returns the PDF inline; 'file' writes it inside the PDFNATIVE_MCP_OUTPUT_DIR sandbox (SECURITY_VIOLATION when the sandbox is not configured).base64
outputPathNoRequired when outputMode='file'. Relative path inside the sandbox; must end with .pdf (no absolute paths, no '..').
pdfsBase64YesBase64-encoded source PDFs to concatenate, in order. 2–50 documents. Signatures and AcroForms are dropped (a page-tree edit invalidates them); encrypted PDFs are rejected.
dropAnnotationsNoWhen true, drop ALL annotations. Default (false) keeps self-contained URI link annotations and drops cross-document/widget annotations.
maxOutputSizeBytesNoIn-memory assembly guard (pdfnative maxOutputSize): the merge throws before materialising an object graph larger than this. Defaults to 268435456 (256 MiB). Note the emitted PDF is separately capped at 50 MiB by the output layer.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeYes
summaryNoTool-specific summary, when produced.
filePathNoSandboxed absolute path (file mode).
sizeBytesYes
diagnosticsNoPDF/A diagnostics (when includeDiagnostics=true).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added
  2. Removedv1.6.0
  3. Addedv1.2.2

TDQS

A4.8/5.0
Behavior5/5

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

Given annotations only cover readOnly/destructive/idempotent hints, the description carries substantial behavioral detail: it explicitly states that signatures and AcroForms are dropped, XMP/PDF-A doesn't survive, page boxes and /UserUnit survive, URI links are kept conditionally, encryption is handled with an optional password, and size guards (256 MiB assembly, 50 MiB output). This goes far beyond what annotations alone reveal and precisely informs the agent of post-conditions and failure modes.

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 dense but well-structured: it opens with the core operation, then systematically discloses page-tree destructive effects, encryption handling, and size guards. Every sentence earns its place; no filler or restatement of the tool name. The front-loaded main operation ensures an agent gets the gist quickly, with edge cases and constraints following logically.

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 fairly complex merge tool with nested `encrypt`/`permissions` objects, 7 parameters, and an existing output schema, the description provides all essential decision-relevant context: drop behavior, encryption behavior, output modes, guard limits, and error signals. Nothing an agent needs to safely invoke this tool is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, and the description reinforces the key parameter semantics beyond the schema: it explains the semantic meaning of `pdfsBase64` (concatenation order), the behavioral consequence on signatures/AcroForms, the conditional behavior of `dropAnnotations`, the assembly guard role of `maxOutputSizeBytes`, and the encryption output implications. This adds real value and clarifies edge cases the schema alone doesn't convey.

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 a specific verb ('Concatenate'), a clear resource ('PDFs'), the input range (2–50), the output type (fresh, self-contained document), and explicitly differentiates behavior from sibling tools by detailing what does and doesn't survive the merge. It is unambiguous and distinctive even among many PDF-related sibling tools.

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 provides explicit contextual behavior and even names the alternative behavior via 'dropAnnotations:true' and the `encrypt` option. It doesn't explicitly say 'use this tool when...' or name a sibling alternative, but the limit and error-code guards make the intended usage clear. The main gap is that it doesn't contrast with split_pdf/extract_pages for page-level operations, but the description sufficiently covers merge-specific use cases.

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