Skip to main content
Glama
@writerslogic/ai-agents-mcp

@writerslogic/ai-agents-mcp

Official

doc_to_markdown

Convert PDF, DOCX, XLSX, PPTX, HTML, Markdown, CSV, JSON or text files into Markdown or plain text, with page, sheet or slide offsets and hashes for accurate agent reading and citation checks.

Instructions

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 checks can anchor to a page. Headings, lists, tables and links are kept for DOCX; sheets become tables; slides become sections. Set describe to also get a suggested descriptive file name, tags and a one-line summary (a fast model reads the first 6,000 characters; its quotes are checked against the text). It does NOT run OCR: scanned PDF pages are flagged needs_ocr and come back empty. Images, comments, notes, headers and footers are ignored, legacy .doc/.xls/.ppt and password-protected files are refused, and ZIP64 is unsupported.

Cost: 0.02 USDC per call, paid automatically over x402 on Base when AGENT_PRIVATE_KEY is configured and the price is within MAX_USDC_PER_CALL.

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 observedv0.2.0

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the annotations: discloses per-call cost (0.02 USDC over x402 on Base, gated by AGENT_PRIVATE_KEY and MAX_USDC_PER_CALL), the exact return shape (content plus one unit per page/sheet/slide with character ranges and SHA-256), the 6,000-character model read for describe, and the needs_ocr failure mode. That the annotations mark readOnlyHint=false is consistent with a paid network operation, not contradicted.

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 verb, resource and output contract, then limitations, then cost — a sensible priority order. It is dense and long, but nearly every sentence carries distinct information; only the format-conversion enumeration runs slightly long.

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 seven-parameter tool with no output schema, the description fully specifies the return structure, unit hashing, truncation behavior, failure modes and payment requirements. Nothing an agent needs in order 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 baseline is 3, but the description adds real meaning: describe calls a fast model on the first 6,000 characters with quotes checked against the text, max_chars cuts at a unit boundary, and pages defaults to the first 200. URL vs base64 and format behavior are clarified further.

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 precise verb and resource set: converts PDF/DOCX/XLSX/PPTX/HTML/Markdown/text/CSV/JSON into Markdown or plain text, with per-page hashes and offsets. The scope ('for an agent that must read or cite a document') makes its role distinguishable from generic page-fetching siblings.

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?

Gives clear context for use (reading or citing a document, quote/citation anchoring) and explicit exclusions (no OCR, refuses legacy .doc/.xls/.ppt and password-protected files, ZIP64 unsupported). It does not, however, name an alternative tool such as transcribe_url or page_contents for the OCR/URL-fetch cases where this tool would fail.

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