Skip to main content
Glama

Convert PDF or HTML to Markdown

convert_to_markdown
DestructiveIdempotent

Convert a local text PDF or saved HTML file into clean Markdown for reading, quoting, summarizing, or indexing, with PDF tables preserved as Markdown tables.

Instructions

Turn a local text PDF or saved HTML file into clean Markdown.

Use this when you want to read, quote, summarize or index a document as text, for example before RAG chunking or pasting into a prompt. Tables are kept as Markdown tables. Do not use it for scanned PDFs or photos (there is no OCR), for live web URLs (save the page as .html first), or when you only need the tables as CSV data (use a PDF table extractor instead).

path: full path to a .pdf or .html file on this computer. tables: PDF tables. "lines" (default) finds tables with border lines, "text" also tries tables lined up by spaces, "off" gives plain text. output_path: optional. If set, the Markdown is saved there and that path is returned. An existing file at that path is replaced. If empty, nothing is written and the Markdown text is returned.

Tables come back as Markdown tables. Scanned (image-only) PDF pages have no text and are skipped.

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": "convert_to_markdown"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYes
tablesNolines
output_pathNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior4/5

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

Annotations declare destructiveHint=true and readOnlyHint=false; the description explains why, stating that an existing file at output_path is replaced and nothing is written when the field is empty. It also discloses that image-only pages are silently skipped, which is a meaningful behavioral caveat. It does not discuss error behavior for missing or malformed files, though the output schema covers the return shape.

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?

Front-loaded with the core action, then exclusions, then per-parameter notes — a sensible ordering. Minor waste: 'Tables are kept as Markdown tables' and 'Tables come back as Markdown tables' say the same thing twice, and the trailing scanned-pages note repeats the earlier no-OCR caveat.

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?

For a three-parameter conversion tool with an output schema, everything an agent needs is present: input constraints, mode selection, write-vs-return behavior, and the documented limitation on scanned pages. Return values need not be described since the output schema exists.

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

Parameters5/5

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

Schema description coverage is 0%, so the description carries the full burden and does: path is constrained to a full local .pdf/.html path, tables enumerates 'lines' (default), 'text' and 'off' with the meaning of each, and output_path explains the save-vs-return branch plus overwrite semantics.

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?

States a specific verb and resource transformation ('Turn a local text PDF or saved HTML file into clean Markdown') and immediately bounds the input types. No siblings exist, so the only job is self-definition, and it does that precisely.

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?

Gives positive triggers (read, quote, summarize, index, before RAG chunking) and explicit exclusions: no OCR for scanned PDFs or photos, no live URLs, use a PDF table extractor when CSV is wanted. An agent can decide correctly without any further inference.

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