Skip to main content
Glama

Document to Markdown for LLM & RAG

tidewell/doc-to-markdown

tidewell--doc-to-markdown
Destructive

This tool calls the Actor "tidewell/doc-to-markdown" and retrieves its output results. Actor description: Returns clean Markdown, or token-sized chunks with page and heading metadata, for each PDF, DOCX, PPTX, XLSX, HTML, EPUB or scanned image. Tables become Markdown tables; scans are read with Tesseract OCR in 25 languages. For RAG, LangChain and LlamaIndex. Pay per document and page.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "tidewell--doc-to-markdown"
  }
}

Input Schema

NameRequiredDescriptionDefault
ocrNoRun Tesseract OCR on images and on PDF pages without a usable text layer. Pages with a text layer are read directly (faster and exact). Example values: true
ocrDpiNoResolution at which scanned PDF pages are rendered for OCR. 300 is a good balance; use 400 for small print. Example values: 300
chunkingNonone: one chunk per page (JSON output). heading: one chunk per section, long sections split by tokens. tokens: fixed-size token windows with overlap that respect paragraph and table boundaries. Example values: "none"none
fileUrlsNoDirect links to PDF, DOCX, PPTX, XLSX/XLS, HTML, EPUB, CSV, JSON, XML, TXT/MD files or PNG/JPEG/TIFF/WebP/GIF/BMP images. Google Drive, Dropbox and GitHub share links are converted to direct downloads automatically. Example values: ["https://arxiv.org/pdf/1706.03762v7"]
forceOcrNoOCR every page even if it has a text layer. Use for PDFs whose embedded text is garbled.
waitSecsNoMax seconds (0–45, default 30) to cap the wait for the Actor run to reach terminal state. For long-running Actors the response returns at the cap with the current run status; follow `nextStep` to poll via get-actor-run. Set to 0 to fire-and-forget.
chunkSizeNoMaximum tokens per chunk (cl100k_base tokenizer, as used by OpenAI embedding models). Example values: 512
datasetIdNoTake file URLs from the items of an Apify dataset, e.g. links collected by a crawler.
pageRangeNoPages to convert, e.g. "1-5,8,10-". Applies to PDF pages, slides, spreadsheet sheets and multi-page TIFF frames. Empty = all.
httpHeadersNoHeaders sent with every download, e.g. {"Authorization": "Bearer ..."} for private file servers.
pageMarkersNoAdd <!-- page N --> comments between pages in the Markdown (PDF, slides, multi-page images). Useful for citations.
pdfPasswordNoPassword for encrypted PDFs (used for every PDF in the run).
chunkOverlapNoTokens repeated from the end of the previous chunk. Capped at half the chunk size. Example values: 64
minImageSizeNoSkip images narrower or shorter than this (icons, bullets, spacer images). Example values: 64
ocrLanguagesNoTesseract language codes. Installed: eng, deu, fra, spa, ita, por, nld, pol, ces, swe, dan, nor, fin, tur, rus, ukr, ell, ara, heb, hin, chi_sim, chi_tra, jpn, kor, vie. Combine several for mixed documents (slower). Example values: ["eng"]
outputFormatNomarkdown: each dataset row holds the full Markdown. json: each row holds chunks[] with page and heading metadata (the full Markdown is still saved to the key-value store). Example values: "markdown"markdown
extractImagesNoSave embedded images to the key-value store and link them from the Markdown (![...](url)).
extractTablesNoDetect ruled tables in PDFs and output them as Markdown tables. Word, PowerPoint, Excel and HTML tables are always converted to Markdown tables. Example values: true
maxFileSizeMbNoFiles larger than this are skipped (not charged). Example values: 100
uploadedFilesNoUpload files from your computer. They are stored in a key-value store and processed like file URLs.
maxConcurrencyNoDocuments converted in parallel. Each extra 4 GB of memory gives the run one more CPU core. Example values: 3
datasetUrlFieldNoItem field that holds the file URL (a string or a list of strings). Example values: "url"url
keyValueStoreIdNoConvert files stored in an Apify key-value store (for example the output of another Actor). Use "default" for this run's own store.
keyValueStoreKeysNoKeys to convert. Leave empty to convert every record in the store (optionally filtered by prefix).
documentTimeoutSecsNoConversion of one document is stopped after this time and reported as failed (not charged). Example values: 300
downloadTimeoutSecsNoMaximum time to download one file. Example values: 120
htmlMainContentOnlyNoDrop navigation, headers, footers and sidebars from HTML pages and keep <main>/<article> when present. Example values: true
keyValueStorePrefixNoWhen no keys are listed, only records whose key starts with this prefix are converted.
maxPagesPerDocumentNoSafety cap on pages converted per document. Example values: 1000
maxImagesPerDocumentNoStop extracting images after this many per document. Example values: 200
removeHeadersFootersNoDrop text repeated at the top or bottom of most PDF pages. Example values: true

Output Schema

NameRequiredDescriptionDefault
tipNoAdvisory guidance RAG Web Browser wrote to its key-value store under the reserved "TIP" key
runIdYesActor run ID
statsNoRun statistics
statusYesRun status: READY | RUNNING | TIMING-OUT | TIMED-OUT | ABORTING | ABORTED | SUCCEEDED | FAILED
actorIdYesStable Apify Actor ID from the run record
summaryYesPast-tense summary of the run state
exitCodeNoActor process exit code; populated for terminal states (especially FAILED)
nextStepYesOne primary follow-up action with identifiers interpolated
storagesYesDataset and key-value store metadata, keyed by alias. "default" is always the primary entry.
actorNameNo"username/actor-name"
startedAtNoISO timestamp when the run started
finishedAtNoISO timestamp when the run finished (terminal states only)
statusMessageNoPass-through from Apify run.statusMessage
apifyConsoleUrlNoPersonalized Apify Console link to the run; present only for Console sessions

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedOutput schema / properties / storages / properties / datasets / additionalProperties / properties / fields / description
      Previous value: -"Dataset field paths in dot notation (e.g. [\"metadata.url\"])"New value: +"Paths that work as a fields selection (e.g. [\"results\", \"metadata.url\"]); an array field appears by its top-level name."
    • changedOutput schema / properties / storages / properties / datasets / properties / default / properties / fields / description
      Previous value: -"Dataset field paths in dot notation (e.g. [\"metadata.url\"])"New value: +"Paths that work as a fields selection (e.g. [\"results\", \"metadata.url\"]); an array field appears by its top-level name."
  2. First observed

TDQS

A3.5/5.0
Behavior3/5

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

The annotations already declare destructiveHint=true and openWorldHint=true, and the description adds genuinely useful non-annotation context: billing is per document and page, scans go through Tesseract OCR in 25 languages, and tables are converted. It does not disclose the asynchronous run lifecycle that the waitSecs parameter implies (the run may return at the cap with only a status, requiring polling), which is the most consequential behavior for an agent invoking this tool.

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?

Two compact sentences with the capability statement front-loaded and the pricing caveat at the end. The only waste is the generic wrapper sentence ('This tool calls the Actor ... and retrieves its output results'), which repeats the tool name without adding information.

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

Completeness4/5

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

With a rich input schema, an output schema, and full annotation coverage, the description is nearly complete: it covers input surface, output shape, OCR capability, chunking intent, and cost model. The one meaningful omission is how the call behaves when the run does not finish within waitSecs, which the schema mentions only in the waitSecs field text.

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% across 31 parameters with detailed per-field documentation, including chunking modes, OCR DPI, page ranges and timeouts, so the schema carries the parameter burden. The description adds no field-level meaning beyond restating that chunked output carries page and heading metadata; baseline 3 applies.

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 names a specific transformation (documents to clean Markdown or token chunks) and enumerates the exact input formats covered (PDF, DOCX, PPTX, XLSX, HTML, EPUB, scans). It is unambiguous what the tool produces, though the opening boilerplate about 'calling the Actor' adds no distinguishing information and no sibling tool is named as a contrast.

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

Usage Guidelines3/5

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

Usage context is only implied through the tagline 'For RAG, LangChain and LlamaIndex' and the per-document/per-page pricing note, which signals a batch conversion workload. There is no explicit when-to-use statement, no mention of when not to use it, and no routing to siblings such as get-dataset-items or get-actor-run for retrieving or polling results.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources