Skip to main content
Glama
DumplingAI

Dumpling AI MCP Server

Official
by DumplingAI

doc-to-text

Convert documents from various formats to plain text for content processing and knowledge management. Extract text from URLs or base64 files with page range selection.

Instructions

Convert various document formats to plain text.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputMethodYesInput method
fileYesURL or base64-encoded file content
pagesNoPages to process (e.g., '1, 2-5')

Implementation Reference

  • The handler function for the 'doc-to-text' tool. It proxies the request to the external Dumpling AI API at /api/v1/doc-to-text, authenticates with DUMPLING_API_KEY, and returns the API response as text content.
    async ({ inputMethod, file, pages }) => {
      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/doc-to-text`, {
        method: "POST",
        headers: {
          "Content-Type": "application/json",
          Authorization: `Bearer ${apiKey}`,
        },
        body: JSON.stringify({ inputMethod, file, pages }),
      });
      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 input schema for the 'doc-to-text' tool, defining parameters: inputMethod (url or base64), file (URL or base64 content), and optional pages.
    {
      inputMethod: z.enum(["url", "base64"]).describe("Input method"),
      file: z.string().describe("URL or base64-encoded file content"),
      pages: z.string().optional().describe("Pages to process (e.g., '1, 2-5')"),
    },
  • src/index.ts:521-545 (registration)
    Registration of the 'doc-to-text' MCP tool using McpServer.tool(), specifying name, description, input schema, and handler function.
    server.tool(
      "doc-to-text",
      "Convert various document formats to plain text.",
      {
        inputMethod: z.enum(["url", "base64"]).describe("Input method"),
        file: z.string().describe("URL or base64-encoded file content"),
        pages: z.string().optional().describe("Pages to process (e.g., '1, 2-5')"),
      },
      async ({ inputMethod, file, pages }) => {
        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/doc-to-text`, {
          method: "POST",
          headers: {
            "Content-Type": "application/json",
            Authorization: `Bearer ${apiKey}`,
          },
          body: JSON.stringify({ inputMethod, file, pages }),
        });
        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 mentions conversion but doesn't specify supported formats, error handling, performance limits, or output details. For a tool with potential complexity in document processing, this lack of context is a significant gap, though it doesn't contradict any annotations.

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 that directly states the tool's purpose without any fluff. It's front-loaded and appropriately sized, making it easy to parse quickly, which is ideal for tool selection in an AI agent context.

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 lack of annotations and output schema, the description is incomplete for a tool that handles document conversion. It doesn't cover behavioral aspects like format support or error cases, and with no output schema, it fails to explain what the plain text output entails. This leaves significant gaps for effective tool use.

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 description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds no additional meaning beyond implying conversion, which aligns with the schema but doesn't provide extra context like examples or constraints. This meets the baseline for high schema coverage.

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 with a specific verb ('Convert') and resource ('various document formats to plain text'), making it immediately understandable. However, it doesn't explicitly distinguish this from sibling tools like 'extract-document' or 'read-pdf-metadata', which might have overlapping functionality, so it doesn't reach the highest 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. With siblings like 'extract-document' and 'convert-to-pdf' available, there's no indication of scenarios where 'doc-to-text' is preferred, such as for text extraction from documents versus other extraction methods, leaving the agent to guess based on tool names alone.

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