Skip to main content
Glama

Merge PDFs

merge_pdfs

Combine several PDFs into one file in a specified order. Writes a new PDF, returns its path, leaves inputs unchanged, and never overwrites existing files.

Instructions

Combine several PDFs on this machine into one, in the order given. The same file may appear more than once. Writes a new PDF and returns its path; the inputs are never modified and an existing file is never overwritten. To combine only some pages, run extract_pdf_pages first. Needs the optional password if an input is encrypted.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputsYesPDF paths, in the order their pages should appear.
outputNoWhere to write the result. Defaults to a new file beside the input. Existing files are never overwritten; a free name like file-1.pdf is used instead.
passwordNoPassword for a PDF that asks for one when opened. Used only on this machine.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A4.5/5.0
Behavior5/5

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

Annotations only give coarse hints (readOnlyHint=false, destructiveHint=false); the description adds real behavioral detail beyond them: inputs are never modified, an existing output file is never overwritten (a free name is chosen instead), and a password is required for encrypted inputs. It also discloses the return value (the new PDF's path).

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?

Four short sentences, front-loaded with what the tool does and the ordering rule, followed by output/return behavior and the encrypted-input caveat. No filler or repetition.

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?

With no output schema, the description correctly supplies the return value (a path), the non-destructive guarantee, the overwrite policy, and the password prerequisite — everything needed to invoke this tool safely and correctly. Nothing material is missing.

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%, so the schema already documents all three parameters including ordering and the no-overwrite default. The description restates ordering and adds a usage condition for the password ('if an input is encrypted'), but adds no syntax or format detail beyond the schema, so the baseline 3 applies.

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 ('Combine several PDFs ... into one') plus the ordering constraint, and names the sibling tool (extract_pdf_pages) relevant to a related-but-different need. An agent can distinguish it from split_pdf or images_to_pdf without opening any 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 the page-subset case to extract_pdf_pages ('To combine only some pages, run extract_pdf_pages first'), which is a concrete alternative with a selecting condition. It does not spell out when-not to use merge_pdfs itself (e.g. vs. split_pdf), but the primary ambiguity is resolved.

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