Skip to main content
Glama

document_to_markdown

Convert PDF, DOCX, or TXT files from public URLs into clean Markdown or text, split into overlapping chunks ready for RAG and embeddings.

Instructions

Convert PDF, DOCX or TXT documents from public URLs into clean Markdown or text, split into overlapping chunks ready for RAG and embeddings.

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": {
      "sources": "<sources>"
    },
    "name": "document_to_markdown"
  }
}

Input Schema

NameRequiredDescriptionDefault
sourcesYesPublic URLs of PDF, DOCX or TXT files.
chunkSizeNoChunk size in characters (default 1500).
extraInputNoAny other input field of the Actor, as documented on its Apify page. Overrides the fields above.
maxResultsNoMaximum number of result items returned to the assistant (default 50). The full dataset stays in your Apify account.
outputFormatNoOutput format (default markdown).
includeFullTextNoInclude the full document text besides the chunks (default true).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description carries the full disclosure burden. It does add genuine behavioral context beyond the schema: the public-URL restriction, the three supported formats, and the fact that output is chunked with overlap for embedding pipelines. However, it says nothing about authentication (this is an Apify Actor run), run duration or rate limits, error handling for failed URLs, or how the chunk overlap is determined.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single sentence that front-loads the conversion action and input formats, then finishes with the output shape. Every clause carries information; there is no filler or restatement of the tool name.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, so the description must convey what comes back, and it does so at a high level (markdown or text chunks plus, per the schema, optionally full text). For a six-parameter tool with a nested free-form extraInput object and no annotations, the definition leaves meaningful gaps around authentication, failure modes, and the Actor-specific override mechanism.

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 coverage is 100%, so every parameter including chunkSize, outputFormat, and includeFullText is already documented in the schema, making 3 the baseline. The description corroborates the output format and chunking behavior but adds no new parameter semantics, notably omitting any mention of the nested extraInput escape hatch, which is the least self-explanatory field in the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description pairs a specific verb ('Convert') with a specific resource ('PDF, DOCX or TXT documents from public URLs') and states the output ('clean Markdown or text, split into overlapping chunks'). That is unambiguous about what the tool produces. It does not differentiate against siblings, but the listed siblings (ats_jobs, seo_audit, etc.) cover unrelated domains, so no natural alternative needs naming.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage context is only implied by the trailing phrase 'ready for RAG and embeddings', which hints at the ingestion use case. There is no explicit when-to-use, when-not-to-use, or prerequisite statement, and no guidance on what to do if a URL is unreachable or the document type is unsupported.

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