Skip to main content
Glama

doc-to-markdown

Document to Markdown with per-page hashes and offsets — Converts a PDF (text layer), DOCX, XLSX or PPTX file, or normalizes an HTML, Markdown, text, CSV or JSON file, into Markdown (or plain text) for an agent that must read or cite a document. Give an https URL or up to 4 MB as base64. Returns the content plus one unit per page, sheet or slide with its exact character range in the content and a SHA-256 of that unit's text, so later quote and citation

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": "doc-to-markdown"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlNohttps URL of the document. Provide this or content_base64.
pagesNoPage, sheet or slide selection such as "1-5,8", at most 200 pages. Default: the first 200.
formatNomarkdown (default) or text (Markdown syntax removed).
describeNoAlso suggest a file name, tags and a summary with a language model. Default false.
filenameNoOriginal file name; helps format detection and is kept as the extension of the suggested name.
max_charsNoOutput cap in characters, cut at a unit boundary. Default 120000.
content_base64NoStandard padded base64 of the file, at most 4 MB decoded. Provide this or url.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does disclose meaningful behavior: the return shape (content plus one unit per page/sheet/slide with exact character range and SHA-256), the input transport limits (https URL or up to 4 MB base64), and the 'text layer' caveat implying scanned PDFs will not extract. It does not mention permissions, rate limits, or error behavior, which keeps it below 5.

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 capability and output summary are front-loaded in a single dense sentence, but the em-dash pileup makes it hard to parse and the text ends mid-clause ('so later quote and citation'), leaving an incomplete thought. It is not padded, but the truncation and run-on structure cost clarity.

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 7-parameter conversion tool with no output schema, the description does explain the return structure (content plus per-unit ranges and hashes), which is the key thing an agent needs. Gaps remain around failure modes for non-text-layer PDFs and truncation interaction with max_chars, but the core is covered.

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, including the enum for format and the page-range syntax, is already documented. The description only restates the https URL and 4 MB base64 constraints, adding no new semantics such as interactions between pages and max_chars or how filename affects detection. 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?

The description names a specific transformation ('Converts a PDF (text layer), DOCX, XLSX or PPTX ... or normalizes an HTML, Markdown, text, CSV or JSON file, into Markdown (or plain text)') and enumerates the input formats supported. The distinctive output ('per-page hashes and offsets') is stated up front, so the agent knows exactly what resource and capability this is.

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 gives a clear use-case frame: 'for an agent that must read or cite a document', and the hash/character-range outputs reinforce the citation scenario. There are no explicit exclusions or named alternatives, but the sibling tools are unrelated utilities, so the contextual guidance is sufficient.

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