Skip to main content
Glama

convert_document_to_markdown

Read-onlyIdempotent

Convert almost any document to clean Markdown from a URL or base64, with automatic format detection and OCR for scanned PDFs and images.

Instructions

Convert almost any document to Markdown in one call: DOCX, PPTX, XLSX, EPUB, HTML, CSV/JSON/XML/TXT and PDF are auto-detected from the URL or base64 content. This is the universal 'just give me the text' tool — use it when the file format is unknown or mixed.

Images and scanned PDFs are routed to OCR automatically when the server
has OCR installed. Legacy .doc/.xls/.ppt binaries are not supported.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlNoPublic http(s) URL of the document to fetch and convert. Leave empty when passing file_base64 instead.
pagesNo1-based page selection like '1,3-5'. Empty means all pages.
offsetNoCharacter offset to resume a truncated conversion.
filenameNoOriginal filename with extension (e.g. 'report.docx'). Used as a format hint when content type cannot be detected automatically.
passwordNoPassword for encrypted PDFs. Empty for normal files.
max_charsNoMaximum characters to return (default 40000, max 200000).
file_base64NoBase64-encoded file content (for documents not reachable by URL). Decoded size limit: 30 MB. Leave empty when passing url instead.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already signal read-only, idempotent, non-destructive behavior, so the description adds useful extra context without contradiction. It discloses auto-detection from URL or base64 content, automatic OCR routing for images/scanned PDFs (with a server-install condition), and unsupported legacy formats. The OCR caveat is a valuable behavioral detail beyond annotations.

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

Conciseness5/5

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

The description is compact and front-loaded: the core capability and format list come first, followed by usage guidance and limitations. Every sentence earns its place; there is no redundant filler.

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 an output schema present and full parameter documentation, the description does not need to explain return values or every parameter. It covers supported formats, input methods, OCR behavior, and legacy exclusions. The only small gap is that it doesn't specify behavior when OCR is not installed, but this is minor.

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?

The input schema covers all 7 parameters with descriptions, so the baseline is 3. The tool description mainly restates the url/file_base64 distinction ('auto-detected from the URL or base64 content') rather than adding new parameter-level meaning, which is acceptable given 100% schema coverage.

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 ('Convert almost any document to Markdown') and enumerates supported formats, making the action unmistakable. The phrase 'universal just give me the text tool' plus 'use it when the file format is unknown or mixed' explicitly positions it against sibling tools like convert_pdf_to_markdown and extract_pdf_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?

It clearly states when to use the tool ('when the file format is unknown or mixed') and gives a concrete exclusion ('Legacy .doc/.xls/.ppt binaries are not supported'). It does not explicitly name a sibling as the alternative for those excluded cases, so it falls just short of a 5.

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