Skip to main content
Glama

Merge PDFs

pdf_merge
Idempotent

Merge multiple PDFs into one file in the order given. Writes the combined PDF to an output path, or returns it as a download when no path is specified.

Instructions

Merge two or more PDFs into one, in the order given, and save or return the result. Source files are read only and never modified; an existing file at output_path is overwritten. Returns the merged PDF written to output_path, or inline as an application/pdf resource when output_path is omitted. This tool only concatenates whole documents: it does not reorder, rotate or delete pages within them, and it does not fill forms — use pdf_fill for a fillable form and pdf_invoice to build a document from data. An unreadable or rejected input fails with an error and writes no file, so a partial merge is never left behind.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pdf_pathsYesIn order, each a PDF source: an absolute file path, an https:// URL, or a data:application/pdf;base64,… URI. Use a URL or data URI when this server runs remotely (Smithery, hosted gateways) where local paths do not exist.
output_pathNoAbsolute path to write the result. Omit when running remotely: the PDF is then returned inline as an application/pdf resource for the client to save.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
bytesYesSize of the produced PDF in bytes
output_pathNoAbsolute path written, when output_path was supplied
resource_uriNopdfops:// uri of the inline application/pdf resource, when output_path was omitted

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.3.2
    • changedInput schema / properties / output_path / description
      Previous value: -"Absolute path to write the merged PDF"New value: +"Absolute path to write the result. Omit when running remotely: the PDF is then returned inline as an application/pdf resource for the client to save."
    • changedInput schema / properties / pdf_paths / description
      Previous value: -"Absolute paths of the PDFs to merge, in order"New value: +"In order, each a PDF source: an absolute file path, an https:// URL, or a data:application/pdf;base64,… URI. Use a URL or data URI when this server runs remotely (Smithery, hosted gateways) where local paths do not exist."
    • changedInput schema / required
      Previous value: -[
      -  "pdf_paths",
      -  "output_path"
      -]New value: +[
      +  "pdf_paths"
      +]
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "bytes": {
      +      "description": "Size of the produced PDF in bytes",
      +      "type": "integer"
      +    },
      +    "output_path": {
      +      "description": "Absolute path written, when output_path was supplied",
      +      "type": "string"
      +    },
      +    "resource_uri": {
      +      "description": "pdfops:// uri of the inline application/pdf resource, when output_path was omitted",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "bytes"
      +  ],
      +  "type": "object"
      +}
  2. First observedv0.2.0

TDQS

A3.9/5.0
Behavior1/5

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

The description adds excellent behavioral detail: sources are never modified, an existing output_path is overwritten, failures write no file, and no partial merge is left behind. However, the explicit overwrite statement contradicts destructiveHint=false, which indicates the tool performs no destructive operations. Per the rubric, this annotation contradiction forces a score of 1.

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 tightly written and front-loaded: operation, safety/overwrite behavior, return behavior, exclusions, and failure semantics each get one clear sentence. No sentence is filler.

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?

The description covers return format, remote vs local invocation, failure atomicity, and exclusions of related tools. Given the schema and output schema already exist, nothing an agent needs to invoke this tool correctly is missing apart from the annotation conflict already flagged.

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 both parameters already have detailed descriptions, so the baseline is 3. The description reinforces ordering and the inline return when output_path is omitted, but it does not add parameter meaning beyond what the schema provides.

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?

Opens with a specific verb and resource: 'Merge two or more PDFs into one, in the order given'. It also distinguishes itself from siblings by explicitly stating it does not fill forms and by routing to pdf_fill and pdf_invoice, so an agent can select it confidently.

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

Usage Guidelines5/5

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

Explicitly says when to use alternatives: 'use pdf_fill for a fillable form and pdf_invoice to build a document from data.' It also gives conditional guidance for output_path (omit when running remotely) and notes it only concatenates whole documents, providing a clear boundary versus related tools.

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

Deploy Server

Other Tools