Skip to main content
Glama

Convert a file to Markdown

file_to_markdown

Convert a document (PDF, DOCX, XLSX, PPTX, HTML, CSV, JSON, TXT or MD) to clean Markdown with headings, lists, tables and links preserved, ready to feed to an AI chat or a notes app. Input: the file's contents as a base64-encoded string plus file_name (its extension declares the format and is verified against the content; max 25 MB, PDFs max 500 pages). Important: the document must contain a real text layer - scanned or image-only PDFs return an error because this tool does not run OCR, and failed calls are not charged. Returns a download_url for the .md file (link valid 24 hours) plus the character count. Costs 1 credit; 5 free calls per month.

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": {
      "file_base64": "<file_base64>",
      "file_name": "<file_name>"
    },
    "name": "file_to_markdown"
  }
}

Input Schema

NameRequiredDescriptionDefault
file_nameYesThe file's name with its real extension, e.g. report.docx or paper.pdf. The extension declares the format and is verified against the content.
file_base64YesThe document's contents as a base64-encoded string (max 25 MB; PDFs max 500 pages). The document must contain a real text layer - scanned or image-only files are rejected because this tool does not run OCR.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.4/5.0
Behavior5/5

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

Goes well beyond the annotations by disclosing cost (1 credit, 5 free calls per month), that failed calls are not charged, the size and page caps, the 24-hour validity of the download_url, and the return payload (character count). The no-OCR failure mode is a behavioral trait an agent must anticipate before invoking, and it is stated plainly without contradicting the readOnlyHint=false / non-destructive annotations.

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-loads the purpose, then the input contract, then the failure caveat, then cost and return value — a sensible ordering for decision-making. It is dense but nearly every clause carries an actionable constraint; the only minor waste is repeating size and OCR limits that also appear in the schema.

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 two-parameter conversion tool with a mutation-adjacent credit charge, the definition covers inputs, limits, failure modes, pricing, and return values. Even though an output schema exists, the explicit mention of download_url and character count is consistent with it and leaves no question about what comes back.

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 both parameters are already documented in the schema, including the base64 requirement and the extension-verification rule. The description largely restates those constraints rather than adding new syntax, encoding, or edge-case guidance beyond what the schema provides.

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 concrete verb and resource ('Convert a document ... to clean Markdown') and enumerates the accepted input formats, so the agent knows exactly what transformation is performed. The acceptance criteria for the conversion ('headings, lists, tables and links preserved') further pin down the output shape in a way no sibling tool overlaps with.

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 a clear use context ('ready to feed to an AI chat or a notes app') and an explicit when-not condition: scanned or image-only PDFs fail because there is no OCR. It does not name sibling tools as alternatives, but the input-format constraints do most of the routing work.

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.