Skip to main content
Glama

convert_document_to_markdown

Read-onlyIdempotent

pdfpeek: Price: USD 0.005; free preview=true, 1/IP/UTC day. For PDF tables as rows use extract_pdf_tables. Use when an agent must read a Word, Excel, PowerPoint, PDF, HTML or EPUB file as Markdown text. Markdown with size (pages, chars, tokens estimated as chars/4). PDF: 100 pages, text layer only; for scans use /v1/pdf/ocr. text_coverage and pages_without_extractable_text report presence, not completeness. Preview: global cap; 1 MB, first 3 PDF pages, 5,000 chars; preview/truncated=true. Failed attempts count. Refused: 409 with unused credentials, else 402 (ChatGPT: capacity error). Full: preview=false; connector allowances apply. Uncharged: unsupported 415, encrypted/damaged 422. Typically 1-5 s. No links fetched or logged. Untrusted output. Docs: https://tanod.dev/learn/document-to-markdown-api.html

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

Input Schema

NameRequiredDescriptionDefault
urlNoPublic HTTP(S), <=20 MB; no private, internal or IP-literal hosts. Or file_base64.
chunksNoheadings: chunks by heading path with sha256 and locator.
previewNoFree preview (1 MB, 3 PDF pages, 5,000 chars); see /learn/document-to-markdown-api.html#preview.
filenameNoPrintable name; .csv hints a table, .txt/.md text.
max_charsNoChunk chars (default 1500); code and table rows stay whole.
merge_modeNoExcel: fill repeats anchors; first/report keep cells. merged_ranges_truncated flags invalid/overlapping/over-cap ranges or missing parts. fill_skipped=true: workbook-wide first fallback on incomplete metadata or >500,000 clipped fill cells. Refs normalized; /llms-full.txt.fill
file_base64NoOr url. <=10 MB decoded; format detected from content.
reading_orderNoPDF only: clear 2-4 columns top to bottom, else source order; reports columns_detected.auto
omit_speaker_notesNoPPTX only: omit notes from Markdown, keep slide text.
skip_hidden_slidesNoPPTX: skip slides marked hidden, keep original slide numbers. Not redaction; visible copies stay.

Output Schema

NameRequiredDescriptionDefault
noteNo
sizeNo
errorNoOnly on an error result: an object {code, message}, or the reason string of an x402 PaymentRequired object.
pagesNo
titleNo
chunksNo
formatNo
sheetsNo
slidesNo
previewNo
markdownNo
warningsNo
operationNo
truncatedNo
charactersNo
full_resultNo
input_bytesNo
fill_skippedNo
merged_rangesNo
text_coverageNo
preview_limitsNo
chunks_truncatedNo
columns_detectedNo
untrusted_contentNo
page_text_charactersNo
merged_ranges_truncatedNo
pages_without_extractable_textNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed10 schema fields changed
    • changedInput schema / properties / chunks / description
      Previous value: -"headings: also return chunks by heading path (H1 > H2 > H3) with sha256 and locator."New value: +"headings: chunks by heading path with sha256 and locator."
    • changedInput schema / properties / file_base64 / description
      Previous value: -"Base64 document, <=10 MB decoded; or url. Format detected from content (see route docs)."New value: +"Or url. <=10 MB decoded; format detected from content."
    • changedInput schema / properties / filename / description
      Previous value: -"Printable name, <=255 chars. Content determines format; .csv hints a table, .txt/.md text."New value: +"Printable name; .csv hints a table, .txt/.md text."
    • changedInput schema / properties / max_chars / description
      Previous value: -"Chunk size, 200-20,000 chars (default 1500); code and table rows stay whole."New value: +"Chunk chars (default 1500); code and table rows stay whole."
    • changedInput schema / properties / merge_mode / description
      Previous value: -"Excel: fill repeats anchors; first/report preserve cells. merged_ranges_truncated flags omitted invalid/overlapping/over-cap ranges or missing parts. fill_skipped=true: workbook-wide first fallback if metadata is incomplete or >500,000 clipped fill cells. Refs normalized; details: /llms-full.txt."New value: +"Excel: fill repeats anchors; first/report keep cells. merged_ranges_truncated flags invalid/overlapping/over-cap ranges or missing parts. fill_skipped=true: workbook-wide first fallback on incomplete metadata or >500,000 clipped fill cells. Refs normalized; /llms-full.txt."
    • changedInput schema / properties / omit_speaker_notes / description
      Previous value: -"PPTX only: omit speaker notes from Markdown. Slide text stays."New value: +"PPTX only: omit notes from Markdown, keep slide text."
    • changedInput schema / properties / preview / description
      Previous value: -"Free bounded preview (1 MB, 3 PDF pages, 5,000 chars); allowances and opt-in: /learn/document-to-markdown-api.html#preview."New value: +"Free preview (1 MB, 3 PDF pages, 5,000 chars); see /learn/document-to-markdown-api.html#preview."
    • changedInput schema / properties / reading_order / description
      Previous value: -"PDF: detect clear 2-4 columns, read each top to bottom; uncertain layouts keep source order. Returns columns_detected per page. Other formats ignore it."New value: +"PDF only: clear 2-4 columns top to bottom, else source order; reports columns_detected."
    • changedInput schema / properties / skip_hidden_slides / description
      Previous value: -"PPTX only: skip slides marked hidden and keep original slide numbers. Not redaction; repeated text on visible slides stays."New value: +"PPTX: skip slides marked hidden, keep original slide numbers. Not redaction; visible copies stay."
    • changedInput schema / properties / url / description
      Previous value: -"Public http(s) document URL, <=20 MB; private/internal/IP-literal hosts refused. Or file_base64."New value: +"Public HTTP(S), <=20 MB; no private, internal or IP-literal hosts. Or file_base64."
  2. Changed1 schema field changed
    • addedInput schema / properties / omit_speaker_notes
      Added value: +{
      +  "default": false,
      +  "description": "PPTX only: omit speaker notes from Markdown. Slide text stays.",
      +  "type": "boolean"
      +}
  3. Changed1 schema field changed
    • addedInput schema / properties / skip_hidden_slides
      Added value: +{
      +  "default": false,
      +  "description": "PPTX only: skip slides marked hidden and keep original slide numbers. Not redaction; repeated text on visible slides stays.",
      +  "type": "boolean"
      +}
  4. Changed4 schema fields changed
    • addedInput schema / properties / chunks
      Added value: +{
      +  "anyOf": [
      +    {
      +      "const": "headings",
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "headings: also return chunks by heading path (H1 > H2 > H3) with sha256 and locator."
      +}
    • addedInput schema / properties / max_chars
      Added value: +{
      +  "anyOf": [
      +    {
      +      "maximum": 20000,
      +      "minimum": 200,
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "Chunk size, 200-20,000 chars (default 1500); code and table rows stay whole."
      +}
    • addedOutput schema / properties / chunks
      Added value: +{
      +  "type": [
      +    "array",
      +    "null"
      +  ]
      +}
    • addedOutput schema / properties / chunks_truncated
      Added value: +{
      +  "type": [
      +    "boolean",
      +    "null"
      +  ]
      +}
  5. Changed21 schema fields changed
    • removedInput schema / properties / file_base64 / default
      Removed value: -null
    • removedInput schema / properties / file_base64 / title
      Removed value: -"File Base64"
    • removedInput schema / properties / filename / default
      Removed value: -null
    • removedInput schema / properties / filename / title
      Removed value: -"Filename"
    • removedInput schema / properties / merge_mode / title
      Removed value: -"Merge Mode"
    • removedInput schema / properties / preview / title
      Removed value: -"Preview"
    • removedInput schema / properties / reading_order / title
      Removed value: -"Reading Order"
    • removedInput schema / properties / url / default
      Removed value: -null
    • removedInput schema / properties / url / title
      Removed value: -"Url"
    • removedInput schema / title
      Removed value: -"convert_document_to_markdownArguments"
    • removedOutput schema / properties / columns_detected / items
      Removed value: -{
      -  "enum": [
      -    1,
      -    2,
      -    3,
      -    4,
      -    null
      -  ],
      -  "type": [
      -    "integer",
      -    "null"
      -  ]
      -}
    • removedOutput schema / properties / merged_ranges / additionalProperties
      Removed value: -{
      -  "items": {
      -    "type": [
      -      "string",
      -      "null"
      -    ]
      -  },
      -  "type": [
      -    "array",
      -    "null"
      -  ]
      -}
    • removedOutput schema / properties / page_text_characters / description
      Removed value: -"PDF source characters per original page, excluding whitespace and control characters, before output truncation; saturated at 500,000 per page. Zero: inspected without extractable text; null: coverage unavailable. Not an OCR or completeness guarantee."
    • removedOutput schema / properties / page_text_characters / items
      Removed value: -{
      -  "maximum": 500000,
      -  "minimum": 0,
      -  "type": [
      -    "integer",
      -    "null"
      -  ]
      -}
    • removedOutput schema / properties / pages_without_extractable_text / description
      Removed value: -"Original 1-based PDF pages inspected without extractable text; may be blank or image-only. Unknown pages are not included; see text_coverage."
    • removedOutput schema / properties / pages_without_extractable_text / items
      Removed value: -{
      -  "maximum": 100,
      -  "minimum": 1,
      -  "type": [
      -    "integer",
      -    "null"
      -  ]
      -}
    • removedOutput schema / properties / preview_limits / properties
      Removed value: -{
      -  "characters": {
      -    "type": [
      -      "integer",
      -      "null"
      -    ]
      -  },
      -  "input_bytes": {
      -    "type": [
      -      "integer",
      -      "null"
      -    ]
      -  },
      -  "pdf_pages": {
      -    "type": [
      -      "integer",
      -      "null"
      -    ]
      -  }
      -}
    • removedOutput schema / properties / size / properties
      Removed value: -{
      -  "chars": {
      -    "description": "Characters of text returned.",
      -    "type": [
      -      "integer",
      -      "null"
      -    ]
      -  },
      -  "note": {
      -    "type": [
      -      "string",
      -      "null"
      -    ]
      -  },
      -  "pages": {
      -    "description": "Pages the text covers; null for formats without pages.",
      -    "type": [
      -      "integer",
      -      "null"
      -    ]
      -  },
      -  "tokens_estimate": {
      -    "description": "chars / 4 rounded up: an estimate, not a tokenizer count.",
      -    "type": [
      -      "integer",
      -      "null"
      -    ]
      -  }
      -}
    • removedOutput schema / properties / text_coverage / description
      Removed value: -"PDF source-page coverage before Markdown truncation, not output completeness. Fallback parsing may leave coverage unknown; no automatic OCR."
    • removedOutput schema / properties / text_coverage / properties
      Removed value: -{
      -  "pages_inspected": {
      -    "maximum": 100,
      -    "minimum": 0,
      -    "type": [
      -      "integer",
      -      "null"
      -    ]
      -  },
      -  "pages_total": {
      -    "maximum": 100,
      -    "minimum": 0,
      -    "type": [
      -      "integer",
      -      "null"
      -    ]
      -  },
      -  "pages_unknown": {
      -    "maximum": 100,
      -    "minimum": 0,
      -    "type": [
      -      "integer",
      -      "null"
      -    ]
      -  },
      -  "pages_with_extractable_text": {
      -    "maximum": 100,
      -    "minimum": 0,
      -    "type": [
      -      "integer",
      -      "null"
      -    ]
      -  },
      -  "pages_without_extractable_text": {
      -    "maximum": 100,
      -    "minimum": 0,
      -    "type": [
      -      "integer",
      -      "null"
      -    ]
      -  }
      -}
    • removedOutput schema / properties / warnings / items
      Removed value: -{
      -  "type": [
      -    "string",
      -    "null"
      -  ]
      -}
  6. Changed4 schema fields changed
    • addedInput schema / properties / preview
      Added value: +{
      +  "default": false,
      +  "description": "Free bounded preview (1 MB, 3 PDF pages, 5,000 chars); allowances and opt-in: /learn/document-to-markdown-api.html#preview.",
      +  "title": "Preview",
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / full_result
      Added value: +{
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
    • addedOutput schema / properties / preview
      Added value: +{
      +  "type": [
      +    "boolean",
      +    "null"
      +  ]
      +}
    • addedOutput schema / properties / preview_limits
      Added value: +{
      +  "properties": {
      +    "characters": {
      +      "type": [
      +        "integer",
      +        "null"
      +      ]
      +    },
      +    "input_bytes": {
      +      "type": [
      +        "integer",
      +        "null"
      +      ]
      +    },
      +    "pdf_pages": {
      +      "type": [
      +        "integer",
      +        "null"
      +      ]
      +    }
      +  },
      +  "type": [
      +    "object",
      +    "null"
      +  ]
      +}
  7. Changed4 schema fields changed
    • addedOutput schema / properties / page_text_characters
      Added value: +{
      +  "description": "PDF source characters per original page, excluding whitespace and control characters, before output truncation; saturated at 500,000 per page. Zero: inspected without extractable text; null: coverage unavailable. Not an OCR or completeness guarantee.",
      +  "items": {
      +    "maximum": 500000,
      +    "minimum": 0,
      +    "type": [
      +      "integer",
      +      "null"
      +    ]
      +  },
      +  "maxItems": 100,
      +  "type": [
      +    "array",
      +    "null"
      +  ]
      +}
    • addedOutput schema / properties / pages_without_extractable_text
      Added value: +{
      +  "description": "Original 1-based PDF pages inspected without extractable text; may be blank or image-only. Unknown pages are not included; see text_coverage.",
      +  "items": {
      +    "maximum": 100,
      +    "minimum": 1,
      +    "type": [
      +      "integer",
      +      "null"
      +    ]
      +  },
      +  "maxItems": 100,
      +  "type": [
      +    "array",
      +    "null"
      +  ],
      +  "uniqueItems": true
      +}
    • addedOutput schema / properties / text_coverage
      Added value: +{
      +  "description": "PDF source-page coverage before Markdown truncation, not output completeness. Fallback parsing may leave coverage unknown; no automatic OCR.",
      +  "properties": {
      +    "pages_inspected": {
      +      "maximum": 100,
      +      "minimum": 0,
      +      "type": [
      +        "integer",
      +        "null"
      +      ]
      +    },
      +    "pages_total": {
      +      "maximum": 100,
      +      "minimum": 0,
      +      "type": [
      +        "integer",
      +        "null"
      +      ]
      +    },
      +    "pages_unknown": {
      +      "maximum": 100,
      +      "minimum": 0,
      +      "type": [
      +        "integer",
      +        "null"
      +      ]
      +    },
      +    "pages_with_extractable_text": {
      +      "maximum": 100,
      +      "minimum": 0,
      +      "type": [
      +        "integer",
      +        "null"
      +      ]
      +    },
      +    "pages_without_extractable_text": {
      +      "maximum": 100,
      +      "minimum": 0,
      +      "type": [
      +        "integer",
      +        "null"
      +      ]
      +    }
      +  },
      +  "type": [
      +    "object",
      +    "null"
      +  ]
      +}
    • addedOutput schema / properties / warnings
      Added value: +{
      +  "items": {
      +    "type": [
      +      "string",
      +      "null"
      +    ]
      +  },
      +  "maxItems": 2,
      +  "type": [
      +    "array",
      +    "null"
      +  ]
      +}
  8. Changed9 schema fields changed
    • changedInput schema / properties / file_base64 / description
      Previous value: -"The document as base64 (at most 10 MB decoded); or use url. DOCX, XLSX, PPTX, PDF, HTML, EPUB, CSV or plain text, detected from the content."New value: +"Base64 document, <=10 MB decoded; or url. Format detected from content (see route docs)."
    • changedInput schema / properties / filename / description
      Previous value: -"Optional original file name (printable, at most 255 characters). The format is detected from the content; the name only breaks ties between text formats (a .csv name makes two delimited lines a table, a .txt or .md name never does)."New value: +"Printable name, <=255 chars. Content determines format; .csv hints a table, .txt/.md text."
    • addedInput schema / properties / merge_mode
      Added value: +{
      +  "default": "fill",
      +  "description": "Excel: fill repeats anchors; first/report preserve cells. merged_ranges_truncated flags omitted invalid/overlapping/over-cap ranges or missing parts. fill_skipped=true: workbook-wide first fallback if metadata is incomplete or >500,000 clipped fill cells. Refs normalized; details: /llms-full.txt.",
      +  "enum": [
      +    "fill",
      +    "first",
      +    "report"
      +  ],
      +  "title": "Merge Mode",
      +  "type": "string"
      +}
    • changedInput schema / properties / reading_order / description
      Previous value: -"For PDF input, detect clear 2-4-column text pages and extract each column top to bottom; uncertain layouts retain their original order. Ignored for other formats. PDF responses include columns_detected per page."New value: +"PDF: detect clear 2-4 columns, read each top to bottom; uncertain layouts keep source order. Returns columns_detected per page. Other formats ignore it."
    • changedInput schema / properties / url / description
      Previous value: -"Public http(s) URL of the document (at most 20 MB; private, internal and IP-literal hosts are refused); or use file_base64."New value: +"Public http(s) document URL, <=20 MB; private/internal/IP-literal hosts refused. Or file_base64."
    • addedOutput schema / properties / fill_skipped
      Added value: +{
      +  "type": [
      +    "boolean",
      +    "null"
      +  ]
      +}
    • addedOutput schema / properties / merged_ranges
      Added value: +{
      +  "additionalProperties": {
      +    "items": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "type": [
      +      "array",
      +      "null"
      +    ]
      +  },
      +  "type": [
      +    "object",
      +    "null"
      +  ]
      +}
    • addedOutput schema / properties / merged_ranges_truncated
      Added value: +{
      +  "type": [
      +    "boolean",
      +    "null"
      +  ]
      +}
    • addedOutput schema / properties / note
      Added value: +{
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
  9. Changed2 schema fields changed
    • addedInput schema / properties / reading_order
      Added value: +{
      +  "default": "auto",
      +  "description": "For PDF input, detect clear 2-4-column text pages and extract each column top to bottom; uncertain layouts retain their original order. Ignored for other formats. PDF responses include columns_detected per page.",
      +  "enum": [
      +    "auto",
      +    "columns"
      +  ],
      +  "title": "Reading Order",
      +  "type": "string"
      +}
    • addedOutput schema / properties / columns_detected
      Added value: +{
      +  "items": {
      +    "enum": [
      +      1,
      +      2,
      +      3,
      +      4,
      +      null
      +    ],
      +    "type": [
      +      "integer",
      +      "null"
      +    ]
      +  },
      +  "type": [
      +    "array",
      +    "null"
      +  ]
      +}
  10. Changed1 schema field changed
    • addedOutput schema / properties / size
      Added value: +{
      +  "properties": {
      +    "chars": {
      +      "description": "Characters of text returned.",
      +      "type": [
      +        "integer",
      +        "null"
      +      ]
      +    },
      +    "note": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "pages": {
      +      "description": "Pages the text covers; null for formats without pages.",
      +      "type": [
      +        "integer",
      +        "null"
      +      ]
      +    },
      +    "tokens_estimate": {
      +      "description": "chars / 4 rounded up: an estimate, not a tokenizer count.",
      +      "type": [
      +        "integer",
      +        "null"
      +      ]
      +    }
      +  },
      +  "type": [
      +    "object",
      +    "null"
      +  ]
      +}
  11. Added

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive/openWorld, and the description adds substantial context beyond that: pricing per call, a 1/IP/UTC-day free preview cap with 1 MB / 3-page / 5,000-char truncation, that failed attempts still count, specific refusal status codes (409/402), uncharged error codes (415/422), expected latency of 1-5 s, and that output is untrusted and no links are fetched or logged.

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

Conciseness3/5

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

The content is dense but the ordering is poor: it opens with 'pdfpeek: Price: USD 0.005' before stating what the tool does, and the semicolon-chained pricing, error-code, and preview details are packed into long fragments. Every fact is arguably useful, but the lack of front-loading makes the primary purpose harder to find.

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 10-parameter, open-world document converter with an output schema, the description covers limits, tiering, error handling, latency, and trust posture. Nothing an agent needs to decide whether and how to call it correctly is missing.

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%, so the schema already carries parameter meaning and the baseline is 3. The description adds concrete preview semantics (1 MB, first 3 PDF pages, 5,000 chars, preview/truncated=true) that the schema only gestures at via a documentation link, giving it value beyond the schema.

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 set: read a Word, Excel, PowerPoint, PDF, HTML or EPUB file as Markdown text. It also explicitly distinguishes itself from the sibling extract_pdf_tables for the PDF-table-as-rows case, so an agent can route correctly without opening schemas.

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 explicit routing conditions: use this for reading documents as Markdown, use extract_pdf_tables for PDF tables as rows, and use /v1/pdf/ocr for scanned PDFs since this tool handles the text layer only. It also notes preview=true is the free tier and preview=false is the full path, which is a clear when-to-use decision.

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