Skip to main content
Glama

convert

Read-only

Transform documents into a chosen text output (Markdown, JSON, HTML, plain text, LaTeX, RAG chunks, WebVTT, Pandoc JSON, or Typst) with options for pages, OCR, images, and passwords.

Instructions

Convert a document to a chosen output format, with conversion options, and return the result as text. to picks the format (Markdown, docling JSON with structure and page provenance, HTML, plain text, LaTeX, RAG chunks, WebVTT, Pandoc JSON); images embeds pictures instead of placeholders; options sets page ranges, OCR language and mode, text-layer-only PDFs, passwords and the rest. For plain Markdown with default settings, convert_to_markdown is the simpler call. Inputs and errors as for convert_to_markdown; an unknown to, images value or option key is an error that says what is accepted. Read-only.

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": {
      "uri": "<uri>"
    },
    "name": "convert"
  }
}

Input Schema

NameRequiredDescriptionDefault
toNoOutput format: md (Markdown, the default), json (docling's DoclingDocument: structure, tables and page provenance), html, text, latex, chunks (RAG-ready chunk records as JSON), vtt (WebVTT, for audio/video transcripts), pandoc (Pandoc's JSON AST) or typst (Typst markup).
uriYesThe document to read: an http: or https: URL (only when the server allows URL fetching — see list_input_formats), a file: URI, a data: URI, or a file path. Relative paths resolve against the server's root; files outside it are refused.
imagesNoPictures in md, html or pandoc output: placeholder (the default, an `<!-- image -->` marker) or embedded (the image as a data: URI).
optionsNoConversion options, docling.rs's shared set (docs/OPTIONS.md), e.g. {"pages": "1-5"}, {"text_layer_only": true} (digital PDFs, fastest; "auto" = the text layer when it has text, OCR when it has none), {"ocr_lang": "ch"}, {"force_full_page_ocr": true}, {"do_picture_ocr": true} (OCR pictures inside Office files), {"password": "…"}, {"compact_tables": false}. A value may also be given as text ("true", "1.5"), as a form sends it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.46.14
    • changedInput schema / properties / to / description
      Previous value: -"Output format: md (Markdown, the default), json (docling's\nDoclingDocument: structure, tables and page provenance), html, text,\nlatex, chunks (RAG-ready chunk records as JSON), vtt (WebVTT, for\naudio/video transcripts) or pandoc (Pandoc's JSON AST)."New value: +"Output format: md (Markdown, the default), json (docling's\nDoclingDocument: structure, tables and page provenance), html, text,\nlatex, chunks (RAG-ready chunk records as JSON), vtt (WebVTT, for\naudio/video transcripts), pandoc (Pandoc's JSON AST) or typst (Typst\nmarkup)."
  2. Changed1 schema field changedv2.46.1
    • changedInput schema / properties / options / description
      Previous value: -"Conversion options, docling.rs's shared set (docs/OPTIONS.md), e.g.\n{\"pages\": \"1-5\"}, {\"text_layer_only\": true} (digital PDFs, fastest),\n{\"ocr_lang\": \"ch\"}, {\"force_full_page_ocr\": true},\n{\"do_picture_ocr\": true} (OCR pictures inside Office files),\n{\"password\": \"…\"}, {\"compact_tables\": false}. A value may also be\ngiven as text (\"true\", \"1.5\"), as a form sends it."New value: +"Conversion options, docling.rs's shared set (docs/OPTIONS.md), e.g.\n{\"pages\": \"1-5\"}, {\"text_layer_only\": true} (digital PDFs, fastest;\n\"auto\" = the text layer when it has text, OCR when it has none),\n{\"ocr_lang\": \"ch\"}, {\"force_full_page_ocr\": true},\n{\"do_picture_ocr\": true} (OCR pictures inside Office files),\n{\"password\": \"…\"}, {\"compact_tables\": false}. A value may also be\ngiven as text (\"true\", \"1.5\"), as a form sends it."
  3. Changed3 schema fields changedv2.46.0
    • changedInput schema / properties / images / description
      Previous value: -"Pictures in md/html/pandoc output: placeholder (default) or\nembedded (data: URIs)."New value: +"Pictures in md, html or pandoc output: placeholder (the default, an\n`<!-- image -->` marker) or embedded (the image as a data: URI)."
    • changedInput schema / properties / to / description
      Previous value: -"Output format: md (default), json (docling's DoclingDocument),\nhtml, text, latex, chunks (RAG chunk records as JSON), vtt, pandoc\n(Pandoc's JSON AST)."New value: +"Output format: md (Markdown, the default), json (docling's\nDoclingDocument: structure, tables and page provenance), html, text,\nlatex, chunks (RAG-ready chunk records as JSON), vtt (WebVTT, for\naudio/video transcripts) or pandoc (Pandoc's JSON AST)."
    • changedInput schema / properties / uri / description
      Previous value: -"The document: an http: or https: URL, a file: URI, a data: URI, or\na path (relative paths resolve against the server's root)."New value: +"The document to read: an http: or https: URL (only when the server\nallows URL fetching — see list_input_formats), a file: URI, a data:\nURI, or a file path. Relative paths resolve against the server's\nroot; files outside it are refused."
  4. Changed1 schema field changedv2.31.0
    • changedInput schema / properties / options / description
      Previous value: -"Conversion options, docling.rs's shared set (docs/OPTIONS.md), e.g.\n{\"pages\": \"1-5\"}, {\"text_layer_only\": true} (digital PDFs, fastest),\n{\"ocr_lang\": \"ch\"}, {\"force_full_page_ocr\": true},\n{\"do_picture_ocr\": true} (OCR pictures inside Office files),\n{\"password\": \"…\"}, {\"compact_tables\": false}."New value: +"Conversion options, docling.rs's shared set (docs/OPTIONS.md), e.g.\n{\"pages\": \"1-5\"}, {\"text_layer_only\": true} (digital PDFs, fastest),\n{\"ocr_lang\": \"ch\"}, {\"force_full_page_ocr\": true},\n{\"do_picture_ocr\": true} (OCR pictures inside Office files),\n{\"password\": \"…\"}, {\"compact_tables\": false}. A value may also be\ngiven as text (\"true\", \"1.5\"), as a form sends it."
  5. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint and openWorldHint, and the description adds genuinely new behavior: unknown `to`/`images`/option keys are hard errors that echo accepted values, out-of-root file paths are refused, and inputs/errors follow `convert_to_markdown`. The closing "Read-only" merely restates the annotation, and return shape ("as text") is stated only in passing.

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 format list, then knowledge that `options` carries everything else, then the alternative-tool routing. Dense but each clause carries information; the one weak sentence is the redundant "Read-only."

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?

For a 4-parameter tool with a free-form nested `options` bag and no output schema, the definition covers formats, image handling, the option surface, refusals, and error behavior. It never states the response envelope or whether binary/embedded images inflate output, which is the only notable gap.

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%, so every parameter is already documented in detail. The description's per-parameter notes (formats, image embedding, page ranges/OCR/passwords) largely paraphrase the schema, adding only the cross-reference that `options` is docling.rs's shared option set. Baseline 3 is appropriate.

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?

Opens with a specific verb and resource ("Convert a document to a chosen output format") and immediately enumerates the target formats, including the distinctive `json` structure/page-provenance and `chunks` modes. It also names the sibling it is not (`convert_to_markdown`), so an agent can distinguish the two without opening either schema.

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?

Explicitly routes the agent: "For plain Markdown with default settings, `convert_to_markdown` is the simpler call," which is the exact selection condition between the two tools. It also points at `list_input_formats` for the server's URL-fetching policy, covering the prerequisite case.

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