Skip to main content
Glama
DumplingAI

Dumpling AI MCP Server

Official
by DumplingAI

merge-pdfs

Combine multiple PDF files into a single document with configurable metadata and compliance options.

Instructions

Combine multiple PDF files into a single document.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputMethodYesInput method
filesYesArray of URLs or base64-encoded PDFs
metadataNoMetadata for merged PDF
pdfaNoPDF/A compliance
pdfuaNoPDF/UA compliance
requestSourceNoRequest source

Implementation Reference

  • The handler function for the 'merge-pdfs' tool. It proxies the request to an external API at NWS_API_BASE/api/v1/merge-pdfs using the provided input parameters, handles authentication with DUMPLING_API_KEY, and returns the JSON response.
    async ({ inputMethod, files, metadata, pdfa, pdfua, requestSource }) => {
      const apiKey = process.env.DUMPLING_API_KEY;
      if (!apiKey) throw new Error("DUMPLING_API_KEY not set");
      const response = await fetch(`${NWS_API_BASE}/api/v1/merge-pdfs`, {
        method: "POST",
        headers: {
          "Content-Type": "application/json",
          Authorization: `Bearer ${apiKey}`,
        },
        body: JSON.stringify({
          inputMethod,
          files,
          metadata,
          pdfa,
          pdfua,
          requestSource,
        }),
      });
      if (!response.ok)
        throw new Error(`Failed: ${response.status} ${await response.text()}`);
      const data = await response.json();
      return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
    }
  • Zod schema defining the input parameters for the 'merge-pdfs' tool: inputMethod (url or base64), files (array of strings), optional metadata object, pdfa compliance option, pdfua boolean, and requestSource.
    {
      inputMethod: z.enum(["url", "base64"]).describe("Input method"),
      files: z.array(z.string()).describe("Array of URLs or base64-encoded PDFs"),
      metadata: z
        .object({
          Title: z.string().optional(),
          Author: z.string().optional(),
          Subject: z.string().optional(),
          Keywords: z.string().optional(),
        })
        .optional()
        .describe("Metadata for merged PDF"),
      pdfa: z
        .enum(["PDF/A-1b", "PDF/A-2b", "PDF/A-3b"])
        .optional()
        .describe("PDF/A compliance"),
      pdfua: z.boolean().optional().describe("PDF/UA compliance"),
      requestSource: z.string().optional().describe("Request source"),
    },
  • src/index.ts:574-619 (registration)
    The server.tool call that registers the 'merge-pdfs' tool with its name, description, input schema, and handler function.
    server.tool(
      "merge-pdfs",
      "Combine multiple PDF files into a single document.",
      {
        inputMethod: z.enum(["url", "base64"]).describe("Input method"),
        files: z.array(z.string()).describe("Array of URLs or base64-encoded PDFs"),
        metadata: z
          .object({
            Title: z.string().optional(),
            Author: z.string().optional(),
            Subject: z.string().optional(),
            Keywords: z.string().optional(),
          })
          .optional()
          .describe("Metadata for merged PDF"),
        pdfa: z
          .enum(["PDF/A-1b", "PDF/A-2b", "PDF/A-3b"])
          .optional()
          .describe("PDF/A compliance"),
        pdfua: z.boolean().optional().describe("PDF/UA compliance"),
        requestSource: z.string().optional().describe("Request source"),
      },
      async ({ inputMethod, files, metadata, pdfa, pdfua, requestSource }) => {
        const apiKey = process.env.DUMPLING_API_KEY;
        if (!apiKey) throw new Error("DUMPLING_API_KEY not set");
        const response = await fetch(`${NWS_API_BASE}/api/v1/merge-pdfs`, {
          method: "POST",
          headers: {
            "Content-Type": "application/json",
            Authorization: `Bearer ${apiKey}`,
          },
          body: JSON.stringify({
            inputMethod,
            files,
            metadata,
            pdfa,
            pdfua,
            requestSource,
          }),
        });
        if (!response.ok)
          throw new Error(`Failed: ${response.status} ${await response.text()}`);
        const data = await response.json();
        return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
      }
    );
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the basic function but fails to mention important behavioral aspects like whether this is a read-only or destructive operation, what permissions are required, how errors are handled, or what the output looks like (e.g., file format, size limits).

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 a single, clear sentence that efficiently communicates the core function without any unnecessary words. It's perfectly front-loaded and wastes no space.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 6 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what the merged PDF output looks like, doesn't mention any constraints or limitations, and provides minimal context for a moderately complex PDF manipulation tool.

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?

The schema description coverage is 100%, so all parameters are documented in the schema. The description adds no additional semantic information about parameters beyond what's already in the schema, meeting the baseline expectation but not providing extra value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose as 'Combine multiple PDF files into a single document' with a specific verb (combine) and resource (PDF files). However, it doesn't explicitly differentiate from sibling tools like 'convert-to-pdf' or 'write-pdf-metadata', which prevents a perfect score.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'convert-to-pdf' or 'write-pdf-metadata'. It lacks any context about prerequisites, limitations, or comparative use cases with sibling tools.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/DumplingAI/mcp-server-dumplingai'

If you have feedback or need assistance with the MCP directory API, please join our Discord server