Skip to main content
Glama

Agent Data Tools: Documents to text

Document to text: Word, Excel, PowerPoint, PDF

document_text
Read-only

Convert a document to text or Markdown: Word (.docx) with headings, lists and tables, Excel (.xlsx) sheet by sheet, PowerPoint (.pptx) slide by slide, a PDF's text, and scanned PDFs or images (PNG, JPEG, WebP) by OCR. Give a public file's URL, or send the file in a POST body (10 MB; images 3 MB). Old .doc/.xls/.ppt and password-protected files fail uncharged. Use to read attachments, scans and spreadsheets into an agent, RAG or a workflow. Example: url=https://calibre-ebook.com/downloads/demos/demo.docx. Price $0.005/call via x402 USDC or a card key (/credits), first 25 free; failed calls free. Reads or computes only and changes nothing; each call is charged, so repeats are not free.

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": {
      "url": "<url>"
    },
    "name": "document_text"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYesAbsolute public http(s) URL of the file (or send the file in a POST body instead)
formatNomarkdown (default: headings, lists and tables kept) or text
maxCharsNoMaximum characters of text returned (1000-200000, default 50000)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Annotations already declare readOnly, openWorld, non-idempotent and non-destructive, and the description adds substantial context beyond them: per-call pricing, a free tier, size limits (10 MB, 3 MB for images), which inputs fail and that failures are uncharged, and that repeat calls are billed so results are not cached. Those cost and failure semantics are exactly the operational facts an agent needs before deciding to call twice.

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?

Key facts are front-loaded (formats first, then input, then limits, then cost), but the prose is a dense run-on and the failure-freeness is stated twice ('fail uncharged' and 'failed calls free'), with the price/credits sentence adding bulk at the tail. It is informative but not tight.

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 3-parameter conversion tool with no output schema, the description covers accepted inputs, traversal semantics, size limits, failure modes and cost, which is nearly everything needed to call it correctly. The remaining gap is what happens when maxChars truncates output, which is left to inference.

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 parameters are already documented; the description still adds meaning by contrasting the two ingest paths (public URL versus POST body) and clarifying that 'markdown' preserves headings, lists and tables while 'text' does not. It says nothing extra about maxChars truncation behavior, which limits the gain.

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 opens with a specific verb and resource ('Convert a document to text or Markdown') and then enumerates exactly which formats are handled and how each is traversed (xlsx sheet by sheet, pptx slide by slide, PDF text, OCR for scans). This scope statement lets an agent distinguish it from narrower siblings such as pdf_text or document_extract without opening a schema.

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 context ('read attachments, scans and spreadsheets into an agent, RAG or a workflow') and a concrete invocation example with a sample URL. It does not explicitly name when to prefer a sibling tool (e.g. a PDF-only converter) or state exclusions beyond the unsupported legacy formats, so guidance stops short of full alternative routing.

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.