Skip to main content
Glama
DumplingAI

Dumpling AI MCP Server

Official
by DumplingAI

convert-to-pdf

Convert files from URLs or base64 encoding to PDF format for standardized document sharing and archiving.

Instructions

Convert various file formats to PDF.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputMethodYesInput method
fileYesURL or base64-encoded file content

Implementation Reference

  • The asynchronous handler function that executes the 'convert-to-pdf' tool logic by making a POST request to an external API endpoint with the provided parameters.
    async ({ inputMethod, file }) => {
      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/convert-to-pdf`, {
        method: "POST",
        headers: {
          "Content-Type": "application/json",
          Authorization: `Bearer ${apiKey}`,
        },
        body: JSON.stringify({ inputMethod, file }),
      });
      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 for input validation: inputMethod as 'url' or 'base64', and file as a string containing the URL or base64 content.
    {
      inputMethod: z.enum(["url", "base64"]).describe("Input method"),
      file: z.string().describe("URL or base64-encoded file content"),
    },
  • src/index.ts:548-571 (registration)
    The server.tool() registration that defines the tool name, description, input schema, and handler function.
    server.tool(
      "convert-to-pdf",
      "Convert various file formats to PDF.",
      {
        inputMethod: z.enum(["url", "base64"]).describe("Input method"),
        file: z.string().describe("URL or base64-encoded file content"),
      },
      async ({ inputMethod, file }) => {
        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/convert-to-pdf`, {
          method: "POST",
          headers: {
            "Content-Type": "application/json",
            Authorization: `Bearer ${apiKey}`,
          },
          body: JSON.stringify({ inputMethod, file }),
        });
        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?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool converts files to PDF but doesn't describe what happens during conversion (e.g., format limitations, error handling, or output characteristics). This is a significant gap for a tool with potential behavioral complexities like file processing.

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, efficient sentence: 'Convert various file formats to PDF.' It's front-loaded with the core purpose and has zero wasted words, making it highly concise and well-structured.

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?

Given the tool's complexity (conversion process) and lack of annotations or output schema, the description is incomplete. It doesn't address behavioral aspects like supported formats, conversion quality, or error cases. For a tool with no structured data to fall back on, this leaves significant gaps.

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%, with clear descriptions for both parameters. The description doesn't add any meaning beyond what the schema provides (e.g., it doesn't explain supported file formats or conversion details). Baseline is 3 since the schema does the heavy lifting.

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: 'Convert various file formats to PDF.' It specifies the action (convert) and resource (file formats to PDF). However, it doesn't distinguish from sibling tools like 'merge-pdfs' or 'write-pdf-metadata' which also handle PDFs, so it lacks sibling differentiation.

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. It doesn't mention prerequisites, context, or exclusions. For example, it doesn't clarify if this is for converting documents, images, or other formats, or how it differs from siblings like 'extract-document' or 'doc-to-text'.

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