Skip to main content
Glama
guanweiqiang

document-converter-mcp

by guanweiqiang

Convert PDF to Markdown

pdf_to_markdown
Read-onlyIdempotent

Extract text content from PDF files and convert to Markdown, with options to clean output for AI use.

Instructions

Extract text content from a PDF file into Markdown format.

IMPORTANT: This is CONTENT EXTRACTION, not layout reconstruction.

  • Scanned PDFs, complex tables, two-column papers, and mathematical formulas may not convert reliably.

  • For scanned PDFs, an OCR engine is required (not included).

  • Default engine is MarkItDown (better text extraction). Falls back to Pandoc if unavailable.

Arguments:

  • inputPath (string, required): Path to the input PDF file

  • outputPath (string, optional): Output path. Defaults to same name with .md

  • engine (enum, optional): Engine — 'markitdown' (default) or 'pandoc'

  • cleanForLLM (boolean, optional): Clean up Markdown for LLM consumption

  • preferSourceSidecar (boolean, optional): When true (default), first check for a source sidecar file (sample.pdf.source.md) and return it instead of extracting PDF text. This is the only reliable way to recover original Markdown structure.

  • overwrite (boolean, optional): Allow overwriting. Defaults to false

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputPathYesPath to the input PDF file (relative to workspace)
outputPathNoOutput Markdown path (relative to workspace). Auto-derived if omitted.
engineNoConversion engine. Defaults to 'markitdown'.
cleanForLLMNoClean up the Markdown output for LLM consumption
preferSourceSidecarNoWhen true (default), first check for a source sidecar file (.source.md) generated by markdown_to_pdf with preserveSource=true. If found, return the original Markdown instead of extracting PDF text. This is the only reliable way to recover structure.
overwriteNoAllow overwriting existing output file. Defaults to false.
Behavior4/5

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

Annotations (readOnly, idempotent) are consistent. Description adds behavioral details: engine fallback, sidecar checking, default overwrite false, and conversion limitations. No contradictions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well-structured with clear sections: intent, warnings, parameter details. Each sentence carries weight; no redundancy. Slightly verbose but justified given complexity.

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

Completeness3/5

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

Lacks output schema, but description explains output is Markdown. Missing details on exact format (page breaks, metadata), error handling, or performance. Acceptable given parameter coverage and annotations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, but description adds meaningful nuance: engine defaults and fallback, outputPath auto-naming, sidecar file pattern, and cleaning purpose. Goes beyond schema documentation.

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?

The description clearly states the tool extracts text content from PDF to Markdown, with a specific verb and resource. It distinguishes from siblings by emphasizing content extraction vs layout reconstruction and noting limitations (scanned PDFs, complex tables).

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?

Provides explicit warnings about unreliable conversions (scanned PDFs, tables, math) and OCR requirements. Also explains sidecar behavior as the only reliable recovery method. Lacks explicit comparison to sibling tools but imparts clear context.

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/guanweiqiang/document-convert-mcp'

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