Skip to main content
Glama
DumplingAI

Dumpling AI MCP Server

Official
by DumplingAI

read-pdf-metadata

Extract metadata such as author, title, and creation date from PDF files using URLs or base64 inputs with the Dumpling AI MCP Server’s document handling capabilities.

Instructions

Extract metadata from PDF files.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filesYesArray of URLs or base64-encoded PDFs
inputMethodYesInput method
requestSourceNoRequest source

Implementation Reference

  • src/index.ts:794-818 (registration)
    Full registration of the 'read-pdf-metadata' MCP tool using server.tool, including name, description, input schema (Zod), and inline async handler that proxies to external Dumpling API endpoint for PDF metadata extraction.
    server.tool( "read-pdf-metadata", "Extract metadata from PDF files.", { inputMethod: z.enum(["url", "base64"]).describe("Input method"), files: z.array(z.string()).describe("Array of URLs or base64-encoded PDFs"), requestSource: z.string().optional().describe("Request source"), }, async ({ inputMethod, files, 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/read-pdf-metadata`, { method: "POST", headers: { "Content-Type": "application/json", Authorization: `Bearer ${apiKey}`, }, body: JSON.stringify({ inputMethod, files, 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 input schema defining parameters for the tool: inputMethod (url or base64), files (array of strings), optional requestSource.
    { inputMethod: z.enum(["url", "base64"]).describe("Input method"), files: z.array(z.string()).describe("Array of URLs or base64-encoded PDFs"), requestSource: z.string().optional().describe("Request source"), },
  • The async handler function implementing the tool logic: checks for DUMPLING_API_KEY, sends POST request to external API with input params, parses response, and returns formatted content.
    async ({ inputMethod, files, 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/read-pdf-metadata`, { method: "POST", headers: { "Content-Type": "application/json", Authorization: `Bearer ${apiKey}`, }, body: JSON.stringify({ inputMethod, files, 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) }] }; }

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