Skip to main content
Glama

PDF to Markdown

pdf_to_markdown
Idempotent

Convert PDFs or selected pages into structured Markdown with headings, lists, tables, and image links, while removing headers, footers, and column order issues for reliable page-cited LLM use.

Instructions

Convert a PDF, or some of its pages, into structured Markdown: headings, paragraphs, lists, tables and image links, with running headers and footers removed and columns in reading order. <!-- page: N --> comments mark where each page starts, so you can cite pages. Images are written to a temporary directory and linked by absolute path (open the file to see a figure); images=false skips them. Output longer than 200000 characters is cut: for long PDFs call pdf_toc first and read the relevant pages. Scanned pages have no text (no OCR); they come back as page images.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "path": "<path>"
    },
    "name": "pdf_to_markdown"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesPath of the PDF file: absolute, or relative to the server's working directory.
pagesNoPages to convert, 1-based: "3", "2-4", "1,5-7". Default: all.
imagesNoWrite the images and link them (default true). false: text only.
passwordNoPassword of an encrypted PDF. Only when an error asks for it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the annotations, it discloses real behavioral traits: running headers/footers are stripped, columns are reordered into reading order, page markers are emitted as `<!-- page: N -->`, images land in a temporary directory, output is truncated at 200000 characters, and scanned pages return no text (no OCR). These are exactly the surprises an agent needs pre-warned, and none contradict the supplied annotations.

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?

Information is front-loaded: output shape first, then page markers, then images, then the truncation limit and the pdf_toc escape hatch. It is dense but each clause carries a distinct fact; only the image-link sentence is slightly verbose.

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

Completeness5/5

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

With no output schema, the description carries the return-value burden and does so fully — it names the Markdown structure, page markers, image link behavior, and truncation limit. For a four-parameter conversion tool, an agent has everything needed to call it correctly and interpret the result.

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 already 100%, so the baseline is 3; the description earns extra credit by adding operational meaning the schema lacks — the password parameter's conditional usage and the practical consequence of images=false (text only, no links). It does not re-explain page-range syntax beyond the schema, which is fine since the schema already carries examples.

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 opens with a specific verb and resource — converting a PDF (or selected pages) into structured Markdown — and enumerates the exact output artifacts (headings, paragraphs, lists, tables, image links). It also distinguishes the tool's role from pdf_toc by naming that sibling for long documents.

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

Usage Guidelines5/5

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

It gives explicit routing advice: 'for long PDFs call pdf_toc first and read the relevant pages,' and it states when to set images=false. It also tells the agent when to supply a password ('only when an error asks for it'), which is a clear when-to-use condition rather than inference.

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

Deploy Server

Other Tools