Skip to main content
Glama

Merge PDF

merge_pdf

Combine two or more PDFs into one new PDF in the order you specify, preserving form fields, links, and the first file’s bookmarks while leaving input files unchanged.

Instructions

Join two or more PDFs into one new PDF, in the order given. Use this to combine files; to pick pages from one file use extract_pdf_pages. Form fields, links and the first file’s bookmarks are kept. Returns the saved path and the total page count; inputs are not changed and an existing file is never overwritten ("name (2).pdf" is used instead).

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": {
      "files": "<files>"
    },
    "name": "merge_pdf"
  }
}

Input Schema

NameRequiredDescriptionDefault
filesYesPDF paths, in order.
outputNoWhere to save the result. Defaults to a new file next to the input.
passwordsNoPasswords for protected inputs, in the same order as files.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already flag non-read-only, non-destructive, non-idempotent, so the description adds real value on top: which artifacts survive (form fields, links, first file's bookmarks), that inputs are untouched, and the collision-avoidance naming ('name (2).pdf'). Rate limits or password failure behavior are not covered, keeping it below 5.

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 dense sentences, front-loaded with the core action, then the alternative, then preservation and return behavior. No filler or repetition of the title.

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?

With no output schema, the description usefully reports the return value (saved path and total page count), and it covers side effects and overwrite policy for a mutating tool. Missing only edge-case behavior such as encrypted inputs or invalid paths.

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?

Schema coverage is 100% and each parameter is already documented, so the schema does the heavy lifting. The description reinforces ordering of inputs but says nothing about the output path or the passwords array that the schema introduces.

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 ('Join two or more PDFs into one new PDF') plus the ordering guarantee, which distinguishes it from extract_pdf_pages and split_pdf without needing 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 Guidelines4/5

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

Explicitly routes page-subset work to extract_pdf_pages, so the main ambiguity is resolved. It stops short of stating exclusions relative to split_pdf or a minimum file count, but the named alternative covers the realistic confusion.

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