Skip to main content
Glama

Extend MCP

Parse a document to markdown/text

parse_document

Convert a document (PDF, image, Office doc, spreadsheet) into clean structured text — markdown by default (parse group). Right when the user wants the content of the pages ("OCR this", "what does this document say", feed text to another step); for specific field values — or when values need source citations/provenance — use extract_data instead. No saved resource needed. Use pageRange to return only the pages of interest; full output of a long document is large, and maxChars caps it. To work on one section of a bundle, split_document it first and parse the relevant segment's fileId. rawBlocks returns block-level structure (tables, figures, coordinates). Async: a status: "running" result with a runId is not an error — resume with get_parse_run passing that runId, the same workspaceId and environment, and wait: true, repeating until the status is terminal; never re-submit the document. On UNAUTHORIZED or NOT_FOUND, re-call get_me for the granted targets. Parse runs cannot be cancelled. truncated: true means the markdown was cut at maxChars — re-call with pageRange for the pages you need, or rawBlocks: true for block-level output. pageRange/maxChars/rawBlocks are not remembered between calls; pass them again when resuming with get_parse_run. Output shape is documented at https://docs.extend.ai/parsing/response-format.md (get_documentation).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileYesDocument to parse. Exactly one of id/url — e.g. { "url": "https://..." } or { "id": "file_..." }, never a bare string.
configNoParse config: { target?, chunkingStrategy?, blockOptions?, advancedOptions? } — e.g. blockOptions.tables.targetFormat, advancedOptions.pageRanges, Excel modes. Before authoring a config by hand, call get_documentation with https://docs.extend.ai/parsing/configuration.md and follow it.
maxCharsNoTruncation cap for returned text (default 50000); response sets truncated: true when hit.
metadataNoArbitrary key-value metadata stored on the run.
pageRangeNoReturn only these 1-indexed pages of the output (post-parse slice; the whole document is still parsed and billed).
rawBlocksNoReturn block-level output (chunks/blocks with types and page metadata) instead of concatenated markdown. Default false.
environmentYes"TEST" = the Test (development) environment, "PRODUCTION" = live. Must match a granted target from get_me (an API key pins one environment).
waitSecondsNoMax seconds to block waiting on the run (clamped to the server wait budget).
workspaceIdYesTarget workspace (ws_...). Must be a granted workspace — get_me lists the accepted values.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileNo
runIdYes
chunksNoBlock-level output (rawBlocks: true).
statusYesTerminal status, or "running" (resume via the get tool).
runTypeNo
markdownNoConcatenated page-delimited markdown (default output).
pageCountNo
truncatedNotrue when markdown was cut at maxChars; re-call with pageRange or rawBlocks for the rest.
failureReasonNo
failureMessageNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • removedOutput schema / properties / llmContext
      Removed value: -{
      -  "type": "string"
      -}
    • addedOutput schema / properties / truncated / description
      Added value: +"true when markdown was cut at maxChars; re-call with pageRange or rawBlocks for the rest."
  2. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Despite annotations providing readOnlyHint=false, idempotentHint=false, destructiveHint=false, the description adds substantial behavioral context: async status 'running' is not an error, runs cannot be cancelled, truncation behavior with truncated flag, and that pageRange/maxChars/rawBlocks are not remembered between calls. This goes far beyond the annotations and is critical for correct usage.

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?

The description is dense but efficient, covering all necessary operational details in a single paragraph. It is front-loaded with the core purpose and usage, then expands into async handling. While long, every sentence conveys essential information; a slightly more structured format could improve readability, but it is not redundant.

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?

Given the tool's complexity (9 params, async, error handling, output schema documented externally), the description is remarkably complete. It covers when to use, how to handle async runs, error recovery, truncation, and configuration guidance. The output schema exists and is referenced via documentation, so absence of inline return details is acceptable.

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% and descriptions are detailed (e.g., file exactly one of id/url, environment must match granted target). The description adds value by explaining how pageRange works (post-parse slice) and that config should be authored via get_documentation, though it doesn't detail each config sub-parameter; the schema covers those adequately. A 4 is justified for the extra behavioral guidance on maxChars and rawBlocks.

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 clearly states the tool converts various document types into structured text (markdown default), explicitly naming the 'parse group' and contrasting with extract_data. It uses a specific verb ('Convert') and resource ('document'), making it distinct from siblings like classify_document or edit_pdf.

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

Usage Guidelines5/5

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

The description explicitly states when to use this tool ('when the user wants the content of the pages', 'OCR this', 'what does this document say'), when NOT to use it (for specific field values or when citations needed, use extract_data), and even guides workflow with split_document for bundle segments. It also covers async resumption and error handling, which is comprehensive.

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