Skip to main content
Glama

Merge Files

merge_files

Merge 2–8 previously uploaded PDF files into a single file. Returns a new fileId for the merged result. The original files are kept. The first fileId in the array appears first (topmost pages) in the merged document — order matters.

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": {
      "fileIds": "<fileIds>",
      "name": "<name>"
    },
    "name": "merge_files"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYesName for the merged file including extension (e.g. 'combined-contract.pdf')
fileIdsYesFile IDs to merge (from upload_file), in the desired page order. The first ID becomes the first pages of the merged document.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Adds real context beyond annotations: 'the original files are kept' (non-destructive in practice), 'returns a new fileId' (no output schema exists, so this is essential), and page-ordering semantics. It doesn't address that repeated calls create duplicate merged files (idempotentHint=false), though the annotation already states that.

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 the action and the return value, then the non-destructive guarantee, then the ordering gotcha. No 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?

With only two parameters, full schema coverage, and no output schema, the description closes the remaining gap by naming the return value (fileId) and the ordering rule. An agent has everything needed to call it correctly.

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 are described there, including the 2–8 bounds and ordering rule. The description's ordering emphasis largely restates the schema, so it earns baseline rather than above-baseline credit.

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 ('merge') and resource ('previously uploaded PDF files') with an explicit cardinality bound (2–8). No sibling tool does merging, and the description makes that unambiguous.

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?

'Previously uploaded' signals the prerequisite (files must exist via upload_file), which is the key usage condition for this tool. There are no exclusion clauses or named alternatives, but none are needed since no sibling overlaps with merging.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources