Skip to main content
Glama

Document to Markdown (PDF, Office, HTML)

ai_document

Use when an agent must read a document it was handed: it turns it into clean Markdown in about a second - pass an https URL or base64 of a PDF, Word, Excel, PowerPoint, HTML, CSV or XML file and get the text back with its headings, tables and page markers, plus the token count. It reads the text layer, so a scanned page with no text layer comes back without text. You are only charged if the Markdown is delivered. No API key, no account. $0.01 per call, paid over x402 (USDC).

Input Schema

NameRequiredDescriptionDefault
urlNohttps URL of the document to convert. Use this or document.
documentNoThe document, as base64. Use this or url.
filenameNoName with extension, e.g. invoice.pdf. Helps the converter pick the parser. Default: taken from the URL.

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?

With no annotations, the description carries the full burden and does so well: it discloses latency (~1 second), the text-layer limitation that makes scanned pages return empty, the billing model ($0.01/call over x402 USDC, charged only if Markdown is delivered), and the absence of any API key or account requirement.

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 when-to-use condition, then capabilities, limitations, and pricing in a single dense paragraph. Every sentence carries information, though the pricing/payment sentence is long enough to slightly slow scanning.

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?

No output schema exists, yet the description explains the return value in detail — Markdown with headings, tables and page markers plus a token count — and flags the main failure mode (no text layer). An agent has everything needed to call it correctly.

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 url, document, and filename are already well documented in the schema. The description restates the either/or input choice ('pass an https URL or base64') but adds no syntax, size limits, or format-selection nuance beyond what the schema provides, so baseline 3 applies.

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 — converts a document into clean Markdown — and enumerates the supported input formats (PDF, Word, Excel, PowerPoint, HTML, CSV, XML). It is clearly distinguishable from siblings like web_read (fetches pages) or ai_transcribe (audio) by scoping to a document the agent was handed.

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?

The trigger is explicit: 'Use when an agent must read a document it was handed.' It does not name alternatives or exclusions (e.g., use web_read for live pages, ai_transcribe for audio), so routing to siblings is left to inference, but the use context itself is unambiguous.

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